<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MEME</title>
<style type="text/css">
    
    /* START INCLUDED FILE "meme.css" */
        /* The following is the content of meme.css */
        body { background-color:white; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif;}

        div.help {
          display: inline-block;
          margin: 0px;
          padding: 0px;
          width: 12px;
          height: 13px;
          cursor: pointer;
          background-image: url("help.gif");
          background-image: url("");
        }
        
        p.spaced { line-height: 1.8em;}
        
        p.pad { padding-left: 30px; padding-top: 5px; padding-bottom: 10px;}

        td.jump { font-size: 13px; color: #ffffff; background-color: #00666a;
          font-family: Georgia, "Times New Roman", Times, serif;}

        a.jump { margin: 15px 0 0; font-style: normal; font-variant: small-caps;
          font-weight: bolder; font-family: Georgia, "Times New Roman", Times, serif;}

        h2.mainh {font-size: 1.5em; font-style: normal; margin: 15px 0 0;
          font-variant: small-caps; font-family: Georgia, "Times New Roman", Times, serif;}

        h2.line {border-bottom: 1px solid #CCCCCC; font-size: 1.5em; font-style: normal;
          margin: 15px 0 0; padding-bottom: 3px; font-variant: small-caps;
          font-family: Georgia, "Times New Roman", Times, serif;}

        h4 {border-bottom: 1px solid #CCCCCC; font-size: 1.2em; font-style: normal;
          margin: 10px 0 0; padding-bottom: 3px; font-family: Georgia, "Times New Roman", Times, serif;}

        h5 {margin: 0px}

        a.help { font-size: 9px; font-style: normal; text-transform: uppercase;
          font-family: Georgia, "Times New Roman", Times, serif;}

        div.pad { padding-left: 30px; padding-top: 5px; padding-bottom: 10px;}
        
        div.pad1 { margin: 10px 5px;}

        div.pad2 { margin: 25px 5px 5px;}
        h2.pad2 { padding: 25px 5px 5px;}

        div.pad3 { padding: 5px 0px 10px 30px;}

        div.box { border: 2px solid #CCCCCC; padding:10px;}

        div.bar { border-left: 7px solid #00666a; padding:5px; margin-top:25px; }

        div.subsection {margin:25px 0px;}

        img {border:0px none;}

        th.majorth {text-align:left;}
        th.minorth {font-weight:normal; text-align:left; width:8em; padding: 3px 0px;}
        th.actionth {font-weight:normal; text-align:left;}

        .strand_name {text-align:left;}
        .strand_side {padding:0px 10px;}
        .strand_start {padding:0px 10px;}
        .strand_pvalue {text-align:center; padding:0px 10px;}
        .strand_lflank {text-align:right; padding-right:5px; font-weight:bold; font-size:large; font-family: 'Courier New', Courier, monospace; color:gray;}
        .strand_seq {text-align:center; font-weight:bold; font-size:large; font-family: 'Courier New', Courier, monospace;}
        .strand_rflank {text-align:left; padding-left:5px; font-weight:bold; font-size:large; font-family: 'Courier New', Courier, monospace; color:gray;}

        .block_td {height:25px;}
        .block_container {position:relative; width:99%; height:25px; padding:0px; margin:0px;}
        .block_motif {position:absolute; z-index:3; height:12px; top:0px; text-align:center; vertical-align:middle; background-color:cyan;}
        .block_rule {position:absolute; z-index:2; width:100%; height:1px; top:12px; left:0px; background-color:gray;}
        .block_plus_sym {position:absolute; z-index:4; width:12px; height:12px; top:0px; left:0px; color:gray;}
        .block_minus_sym {position:absolute; z-index:4; width:12px; height:12px; top:13px; left:0px; color:gray;}

        .tic_major {position:absolute; border-left:2px solid blue; height:0.5em; top:0em;}
        .tic_minor {position:absolute; border-left:1px solid blue; height:0.2em; top:0em;}
        .tic_label {position:absolute; top:0.5em;  height: 1em; text-align:center; vertical-align:middle}

        .explain h5 {font-size:1em; margin-left: 1em;}

        div.doc {margin-left: 2em; margin-bottom: 3em;}
        
        div.tabArea {
          font-size: 80%;
          font-weight: bold;
        }

        a.tab {
          background-color: #ddddff;
          border: 1px solid #000000;
          border-top-width: 0px;
          padding: 2px 1em 2px 1em;
          text-decoration: none;
        }

        a.tab, a.tab:visited {
          color: #808080;
        }

        a.tab:hover {
          background-color: #d0d0d0;
          color: #606060;
        }
        a.tab.activeTab, a.tab.activeTab:hover, a.tab.activeTab:visited {
          background-color: #f0f0f0;
          color: #000000;
        }
        div.tabMain {
          border: 1px solid #000000;
          background-color: #ffffff;
          padding: 5px;
          margin-right: 5px;
        }
        th.trainingset {
          border-bottom: thin dashed black; 
          font-weight:normal; 
          padding:0px 10px;
        }

    /* END INCLUDED FILE "meme.css" */
    
  </style>
<script type="text/javascript">
    
    /* START INCLUDED FILE "motif_logo.js" */
    //======================================================================
    // start Alphabet object
    //======================================================================
    function Alphabet(alphabet, bg) {
      //variable prototype
      this.freqs = new Array();
      this.alphabet = new Array();
      this.letter_count = 0;
      //method prototype
      this.get_ic = Alphabet_get_ic;
      this.get_size = Alphabet_get_size;
      this.get_index = Alphabet_get_index;
      this.get_letter = Alphabet_get_letter;
      this.get_colour = Alphabet_get_colour;
      this.get_bg_freq = Alphabet_get_bg_freq;
      this.is_nucleotide = Alphabet_is_nucleotide;
      this.is_ambig = Alphabet_is_ambig;
      this.toString = Alphabet_to_string;
      //construct
      var is_letter = /^\w$/;
      var is_prob = /^((1(\.0+)?)|(0(\.\d+)?))$/;
      for (var pos = 0; pos < alphabet.length; pos++) {
        var letter = alphabet.charAt(pos);
        if (is_letter.test(letter)) {
          this.alphabet[this.letter_count] = letter.toUpperCase();
          this.freqs[this.letter_count] = -1;
          this.letter_count++;
        }
      }
      if (!(bg === undefined)) {
        var parts = bg.split(/\s+/);
        for (var i = 0, pos = 0; (i + 1) < parts.length; i += 2) {
          var letter = parts[i];
          var freq = parts[i+1];
          if (is_letter.test(letter) && is_prob.test(freq)) {
            letter = letter.toUpperCase();          //find the letter it matches
            for (;pos < this.letter_count; pos++) {
              if (this.alphabet[pos] == letter) break;
            }
            if (pos >= this.letter_count) throw "NOT_IN_ALPHABET";
            this.freqs[pos] = (+freq);
          }
        }
      }
    }


    function Alphabet_get_ic() {
      if (this.is_nucleotide()) {
        return 2;
      } else {
        return Math.log(20) / Math.LN2;
      }
    }

    function Alphabet_get_size() {
      return this.letter_count;
    }

    function Alphabet_get_letter(alph_index) {
      if (alph_index < 0 || alph_index >= this.letter_count) {
        throw "BAD_ALPHABET_INDEX";
      }
      return this.alphabet[alph_index];
    }

    function Alphabet_get_bg_freq(alph_index) {
      if (alph_index < 0 || alph_index >= this.letter_count) {
        throw "BAD_ALPHABET_INDEX";
      }
      if (this.freqs[alph_index] == -1) throw "BG_FREQ_NOT_SET";
      return this.freqs[alph_index];
    }

    function Alphabet_get_colour(alph_index) {
      var red = "rgb(204,0,0)";
      var blue = "rgb(0,0,204)";
      var orange = "rgb(255,179,0)";
      var green = "rgb(0,128,0)";
      var yellow = "rgb(255,255,0)";
      var purple = "rgb(204,0,204)";
      var magenta = "rgb(255,0,255)";
      var pink = "rgb(255,204,204)";
      var turquoise = "rgb(51,230,204)";
      if (alph_index < 0 || alph_index >= this.letter_count) {
        throw "BAD_ALPHABET_INDEX";
      }
      if (this.is_nucleotide()) {
        switch (this.alphabet[alph_index]) {
          case "A":
            return red;
          case "C":
            return blue;
          case "G":
            return orange;
          case "T":
            return green;
        }
      } else {
        switch (this.alphabet[alph_index]) {
          case "A":
          case "C":
          case "F":
          case "I":
          case "L":
          case "V":
          case "W":
          case "M":
            return blue;
          case "N":
          case "Q":
          case "S":
          case "T":
            return green;
          case "D":
          case "E":
            return magenta;
          case "K":
          case "R":
            return red;
          case "H":
            return pink;
          case "G":
            return orange;
          case "P":
            return yellow;
          case "Y":
            return turquoise;
        }
      }
      return "black";
    }

    function Alphabet_is_ambig(alph_index) {
      if (alph_index < 0 || alph_index >= this.letter_count) {
        throw "BAD_ALPHABET_INDEX";
      }
      if (this.is_nucleotide()) {
        return ("ACGT".indexOf(this.alphabet[alph_index]) == -1);
      } else {
        return ("ACDEFGHIKLMNPQRSTVWY".indexOf(this.alphabet[alph_index]) == -1);
      }
    }

    function Alphabet_get_index(letter) {
      for (i = 0; i < this.letter_count; i++) {
        if (this.alphabet[i] == letter.toUpperCase()) return i;
      }
      throw "UNKNOWN_LETTER";
    }

    function Alphabet_is_nucleotide() {
      //TODO basic method, make better
      if (this.letter_count < 20) return true;
      return false;
    }

    function Alphabet_to_string() {
      return (this.is_nucleotide() ? "Nucleotide" : "Protein") + " Alphabet " + (this.alphabet.join(""));
    }

    //======================================================================
    // end Alphabet object
    //======================================================================

    //======================================================================
    // start Symbol object
    //======================================================================
    function Symbol(alph_index, scale, alphabet) {
      //variable prototype
      this.symbol = alphabet.get_letter(alph_index);
      this.scale = scale;
      this.colour = alphabet.get_colour(alph_index);
      //function prototype
      this.get_symbol = Symbol_get_symbol;
      this.get_scale = Symbol_get_scale;
      this.get_colour = Symbol_get_colour;
      this.toString = Symbol_to_string;
    }

    function Symbol_get_symbol() {
      return this.symbol;
    }

    function Symbol_get_scale() {
      return this.scale;
    }

    function Symbol_get_colour() {
      return this.colour;
    }

    function Symbol_to_string() {
      return this.symbol + " " + (Math.round(this.scale*1000)/10) + "%";
    }

    function compare_symbol(sym1, sym2) {
      if (sym1.get_scale() < sym2.get_scale()) {
        return -1;
      } else if (sym1.get_scale() > sym2.get_scale()) {
        return 1;
      } else {
        return 0;
      }
    }
    //======================================================================
    // end Symbol object
    //======================================================================

    //======================================================================
    // start Pspm object
    //======================================================================
    function Pspm(pssm, name, ltrim, rtrim) {
      if (ltrim === undefined) ltrim = 0;
      if (rtrim === undefined) rtrim = 0;
      //variable prototype
      this.alph_length = 0;
      this.motif_length = 0;
      this.pspm = new Array();
      this.name = (typeof name == "string" ? name : "");
      this.nsites = 0;
      this.evalue = 0;
      this.ltrim = ltrim;
      this.rtrim = rtrim;
      //function prototype
      this.copy = Pspm_copy;
      this.reverse_complement = Pspm_reverse_complement;
      this.get_stack = Pspm_get_stack;
      this.get_stack_ic = Pspm_get_stack_ic;
      this.get_motif_length = Pspm_get_motif_length;
      this.get_alph_length = Pspm_get_alph_length;
      this.get_left_trim = Pspm_get_left_trim;
      this.get_right_trim = Pspm_get_right_trim;
      this.toString = Pspm_to_string;
      //construct
      var pspm_header = /letter-probability matrix:\s+alength=\s+(\d+)\s+w=\s+(\d+)(\s+nsites=\s+(\S+))?(\s+E=\s+(\S+))?\s*/;
      var is_empty = /^\s*$/;
      var lines = pssm.split(/\s*\n\s*/);
      var read_pssm = false;
      var line_num = 0;
      var col_num = 0;
      for (line_index in lines) {
        //exclude inherited properties and undefined properties
        if (!lines.hasOwnProperty(line_index) || lines[line_index] === undefined) continue;

        var line = lines[line_index];
        if (is_empty.test(line)) {
          continue;
        }
        if (!read_pssm) {
          var header_match = pspm_header.exec(line);
          if (header_match != null) {
            read_pssm = true;
            this.alph_length = (+header_match[1]);
            this.motif_length = (+header_match[2]);
            if (header_match[4]) this.nsites = parseFloat(header_match[4]);//not always an integer
            if (header_match[6]) this.evalue = parseFloat(header_match[6]);
            this.pspm = new Array(this.motif_length);
          }
          continue;
        }
        if (line_num >= this.motif_length) {
          throw "TOO_MANY_ROWS";
        }
        this.pspm[line_num] = new Array(this.alph_length);
        col_num = 0;
        var parts = line.split(/\s+/);
        for (part_index in parts) {
          //exclude inherited properties and undefined properties
          if (!parts.hasOwnProperty(part_index) || parts[part_index] === undefined) continue;
          
          var prob = parts[part_index];
          if (col_num >= this.alph_length) {
            throw "TOO_MANY_COLS";
          }
          this.pspm[line_num][col_num] = (+prob);
          //check the probability is within bounds
          if (this.pspm[line_num][col_num] > 1 || this.pspm[line_num][col_num] < 0) {
            throw "NUM_NOT_PROB";
          }
          col_num++;
        }
        if (col_num != this.alph_length) {
          throw "TOO_FEW_COLS";
        }
      line_num++;
      }
      if (line_num != this.motif_length) {
        throw "TOO_FEW_ROWS";
      }
    }

    function Clone() {}

    function Pspm_copy() {
      Clone.prototype = this;
      var clone = new Clone();
      //so far only a shallow copy, need to copy everything
      clone.alph_length = (0+this.alph_length);
      clone.motif_length = (0+this.motif_length);
      clone.name = (""+this.name);
      clone.nsites = (0+this.nsites);
      clone.evalue = (0+this.evalue);
      clone.ltrim = (0+this.ltrim);
      clone.rtrim = (0+this.rtrim);
      clone.pspm = new Array(this.motif_length);
      for (row = 0; row < this.motif_length; row++) {
        clone.pspm[row] = new Array(this.alph_length);
        for (col = 0; col < this.alph_length; col++) {
          clone.pspm[row][col] = (0+this.pspm[row][col]);
        }
      }
      return clone;
    }

    function Pspm_reverse_complement(alphabet) {
      if (this.alph_length != alphabet.get_size()) {
        throw "ALPHABET_MISMATCH";
      }
      if (!alphabet.is_nucleotide()) {
        throw "NO_PROTEIN_RC";
      }
      //reverse
      var x = 0;
      var y = this.motif_length-1;
      while (x < y) {
        var temp = this.pspm[x];
        this.pspm[x] = this.pspm[y];
        this.pspm[y] = temp;
        x++;
        y--;
      }
      //complement
      var a_index = alphabet.get_index("A");
      var c_index = alphabet.get_index("C");
      var g_index = alphabet.get_index("G");
      var t_index = alphabet.get_index("T");
      for (i = 0; i < this.motif_length; i++) {
        var row = this.pspm[i];
        //swap A and T
        var temp = row[a_index];
        row[a_index] = row[t_index];
        row[t_index] = temp;
        //swap C and G
        temp = row[c_index];
        row[c_index] = row[g_index];
        row[g_index] = temp;
      }
      //swap triming
      var temp_trim = this.ltrim;
      this.ltrim = this.rtrim;
      this.rtrim = temp_trim;
      //note that ambigs are ignored because they don't effect motifs
      return this; //allow function chaining...
    }

    function Pspm_get_stack(position, alphabet) {
      if (this.alph_length != alphabet.get_size()) {
        throw "ALPHABET_MISMATCH";
      }
      var row = this.pspm[position];
      var stack_ic = this.get_stack_ic(position, alphabet);
      var alphabet_ic = alphabet.get_ic();
      var stack = new Array();
      for (i = 0; i < this.alph_length; i++) {
        if (alphabet.is_ambig(i)) continue;
        var sym = new Symbol(i, row[i]*stack_ic/alphabet_ic, alphabet);
        if (sym.get_scale() <= 0) continue;
        stack.push(sym);
      }
      stack.sort(compare_symbol);
      return stack;
    }

    function Pspm_get_stack_ic(position, alphabet) {
      if (this.alph_length != alphabet.get_size()) {
        throw "ALPHABET_MISMATCH";
      }
      var row = this.pspm[position];
      var H = 0;
      for (var i = 0; i < this.alph_length; i++) {
        if (alphabet.is_ambig(i)) continue;
        if (row[i] == 0) continue;
        H -= (row[i] * (Math.log(row[i]) / Math.LN2));
      }
      return alphabet.get_ic() - H;
    }

    function Pspm_get_error(alphabet) {
      var asize;
      if (this.nsites == 0) return 0;
      if (alphabet.is_nucleotide()) {
        asize = 4;
      } else {
        asize = 20;
      }
      return (asize-1) / (2 * Math.log(2)*this.nsites);
    }

    function Pspm_get_motif_length() {
      return this.motif_length;
    }

    function Pspm_get_alph_length() {
      return this.alph_length;
    }

    function Pspm_get_left_trim() {
      return this.ltrim;
    }

    function Pspm_get_right_trim() {
      return this.rtrim;
    }

    function Pspm_to_string() {
      var str = "";
      for (row_index in this.pspm) {
        //exclude inherited properties and undefined properties
        if (!this.pspm.hasOwnProperty(row_index) || this.pspm[row_index] === undefined) continue;
        
        var row = this.pspm[row_index];
        str += row.join("\t") + "\n";
      }
      return str;
    }
    //======================================================================
    // end Pspm object
    //======================================================================
    
    //======================================================================
    // start Logo object
    //======================================================================
    function Logo(alphabet, fine_text) {
      this.alphabet = alphabet;
      this.fine_text = fine_text;
      this.pspm_list = [];
      this.pspm_column = [];
      this.rows = 0;
      this.columns = 0;

      //functions
      this.add_pspm = Logo_add_pspm;
      this.get_columns = Logo_get_columns;
      this.get_rows = Logo_get_rows;
      this.get_pspm = Logo_get_pspm;
      this.get_offset = Logo_get_offset;
    }

    function Logo_add_pspm(pspm, column) {
      if (column === undefined) column = 0;
      else if (column < 0) throw "COLUMN_OUT_OF_BOUNDS";
      this.pspm_list[this.rows] = pspm;
      this.pspm_column[this.rows] = column;
      this.rows++;
      var col = column + pspm.get_motif_length();
      if (col > this.columns) this.columns = col;
    }

    function Logo_get_columns() {
      return this.columns;
    }

    function Logo_get_rows() {
      return this.rows;
    }

    function Logo_get_pspm(row_index) {
      if (row_index < 0 || row_index >= this.rows) throw "INDEX_OUT_OF_BOUNDS";
      return this.pspm_list[row_index];
    }

    function Logo_get_offset(row_index) {
      if (row_index < 0 || row_index >= this.rows) throw "INDEX_OUT_OF_BOUNDS";
      return this.pspm_column[row_index];
    }

    //======================================================================
    // end Logo object
    //======================================================================

    //======================================================================
    // start RasterizedAlphabet
    //======================================================================

    // Rasterize Alphabet
    // 1) Measure width of text at default font for all symbols in alphabet
    // 2) sort in width ascending
    // 3) Drop the top and bottom 10% (designed to ignore outliers like 'W' and 'I')
    // 4) Calculate the average as the maximum scaling factor (designed to stop I becoming a rectangular blob).
    // 5) Assume scale of zero would result in width of zero, interpolate scale required to make perfect width font
    // 6) Draw text onto temp canvas at calculated scale
    // 7) Find bounds of drawn text
    // 8) Paint on to another canvas at the desired height (but only scaling width to fit if larger).
    function RasterizedAlphabet(alphabet, font, target_width) {
      //variable prototypes
      this.lookup = []; //a map of letter to index
      this.rasters = []; //a list of rasters
      this.dimensions = []; //a list of dimensions

      //function prototypes
      this.draw = RasterizedAlphabet_draw;

      //construct
      var default_size = 60; // size of square to assume as the default width
      var safety_pad = 20; // pixels to pad around so we don't miss the edges
      // create a canvas to do our rasterizing on
      var canvas = document.createElement("canvas");
      // assume the default font would fit in a canvas of 100 by 100
      canvas.width = default_size + 2 * safety_pad;
      canvas.height = default_size + 2 * safety_pad;
      // check for canvas support before attempting anything
      if (!canvas.getContext) throw "NO_CANVAS_SUPPORT";
      var ctx = canvas.getContext('2d');
      // check for html5 text drawing support
      if (!supports_text(ctx)) throw "NO_CANVAS_TEXT_SUPPORT";
      // calculate the middle
      var middle = Math.round(canvas.width / 2);
      // calculate the baseline
      var baseline = Math.round(canvas.height - safety_pad);
      // list of widths
      var widths = [];
      var count = 0;
      var letters = [];
      //now measure each letter in the alphabet
      for (var i = 0; i < alphabet.get_size(); ++i) {
        if (alphabet.is_ambig(i)) continue; //skip ambigs as they're never rendered
        var letter = alphabet.get_letter(i);
        letters.push(letter);
        var pos = count++;
        this.lookup[letter] = pos;
        //clear the canvas
        canvas.width = canvas.width;
        // get the context and prepare to draw our width test
        var ctx = canvas.getContext('2d');
        ctx.font = font;
        ctx.fillStyle = alphabet.get_colour(i);
        ctx.textAlign = "center";
        ctx.translate(middle, baseline);
        // draw the test text
        ctx.fillText(letter, 0, 0);
        //measure
        var size = RasterizedAlphabet_measure(ctx, canvas.width, canvas.height);
        if (size.width == 0) throw "INVISIBLE_LETTER"; //maybe the fill was white on white?
        widths.push(size.width);
        this.dimensions[pos] = size;
      }
      //sort the widths
      widths.sort(function(a,b) {return a - b;});
      //drop 10% of the items off each end
      var tenpercent = Math.floor(widths.length / 10);
      for (var i = 0; i < tenpercent; ++i) {
        widths.pop();
        widths.shift();
      }
      //calculate average width
      var avg_width = 0;
      for (var i = 0; i < widths.length; ++i) avg_width += widths[i];
      avg_width /= widths.length;
      // calculate scales
      for (var i = 0; i < this.dimensions.length; ++i) {
        var size = this.dimensions[i];
        // calculate scale
        var scale = target_width / Math.max(avg_width, size.width);
        // estimate scaled height
        var target_height = size.height * scale;
        // create an approprately sized canvas
        var raster = document.createElement("canvas");
        raster.width = target_width; // if it goes over the edge too bad...
        raster.height = target_height + safety_pad * 2;
        // calculate the middle
        middle = Math.round(raster.width / 2);
        // calculate the baseline
        baseline = Math.round(raster.height - safety_pad);
        // get the context and prepare to draw the rasterized text
        ctx = raster.getContext('2d');
        ctx.font = font;
        ctx.fillStyle = alphabet.get_colour(i);
        ctx.textAlign = "center";
        ctx.translate(middle, baseline);
        ctx.save();
        ctx.scale(scale, scale);
        // draw the rasterized text
        ctx.fillText(letters[i], 0, 0);
        ctx.restore();
        this.rasters[i] = raster;
        this.dimensions[i] = RasterizedAlphabet_measure(ctx, raster.width, raster.height);
      }
    }

    function RasterizedAlphabet_measure(ctx, cwidth, cheight) {
      var data = ctx.getImageData(0, 0, cwidth, cheight).data;
      var r = 0, c = 0;// r: row, c: column
      var top_line = -1, bottom_line = -1, left_line = -1, right_line = -1;
      var txt_width = 0, txt_height = 0;
      // Find the top-most line with a non-white pixel
      for (r = 0; r < cheight; r++) {
        for (c = 0; c < cwidth; c++) {
          if (data[r * cwidth * 4 + c * 4 + 3]) {
            top_line = r;
            break;
          }
        }
        if (top_line != -1) break;
      }
      
      //find the last line with a non-white pixel
      if (top_line != -1) {
        for (r = cheight-1; r >= top_line; r--) {
          for(c = 0; c < cwidth; c++) {
            if(data[r * cwidth * 4 + c * 4 + 3]) {
              bottom_line = r;
              break;
            }
          }
          if (bottom_line != -1) break;
        }
        txt_height = bottom_line - top_line + 1;
      }

      // Find the left-most line with a non-white pixel
      for (c = 0; c < cwidth; c++) {
        for (r = 0; r < cheight; r++) {
          if (data[r * cwidth * 4 + c * 4 + 3]) {
            left_line = c;
            break;
          }
        }
        if (left_line != -1) break;
      }

      //find the right most line with a non-white pixel
      if (left_line != -1) {
        for (c = cwidth-1; c >= left_line; c--) {
          for(r = 0; r < cheight; r++) {
            if(data[r * cwidth * 4 + c * 4 + 3]) {
              right_line = c;
              break;
            }
          }
          if (right_line != -1) break;
        }
        txt_width = right_line - left_line + 1;
      }

      //return the bounds
      return {bound_top: top_line, bound_bottom: bottom_line, bound_left: left_line, bound_right: right_line, width: txt_width, height: txt_height};
    }

    function RasterizedAlphabet_draw(ctx, letter, dx, dy, dWidth, dHeight) {
      var index = this.lookup[letter];
      var raster = this.rasters[index];
      var size = this.dimensions[index];
      ctx.drawImage(raster, 0, size.bound_top -1, raster.width, size.height+1, dx, dy, dWidth, dHeight);
    }

    //======================================================================
    // end RasterizedAlphabet
    //======================================================================

    //======================================================================
    // start LogoMetrics object
    //======================================================================

    function LogoMetrics(ctx, canvas_width, canvas_height, logo_columns, logo_rows, allow_space_for_names) {
      if (allow_space_for_names === undefined) allow_space_for_names = false;
      //variable prototypes
      this.canvas_width = canvas_width;
      this.canvas_height = canvas_height;
      this.scale_x = 1;
      this.scale_y = 1;
      this.pad_top = 5;
      this.pad_left = 10;
      this.pad_right = 5;
      this.pad_bottom = 0;
      this.pad_middle = 20;
      this.name_height = 14;
      this.name_font = "bold " + this.name_height + "px Times, sans-serif";
      this.name_spacer = 0;
      this.y_label = "bits"
      this.y_label_height = 12;
      this.y_label_font = "bold " + this.y_label_height + "px Helvetica, sans-serif";
      this.y_label_spacer = 3;
      this.y_num_height = 12;
      this.y_num_width = 0;
      this.y_num_font = "bold " + this.y_num_height + "px Helvetica, sans-serif";
      this.y_tic_width = 5;
      this.stack_pad_left = 0;
      this.stack_font = "bold 25px Helvetica, sans-serif";
      this.stack_height = 90;
      this.stack_width = 26;
      this.stacks_pad_right = 5;
      this.x_num_above = 2;
      this.x_num_height = 12;
      this.x_num_width = 0;
      this.x_num_font = "bold " + this.x_num_height + "px Helvetica, sans-serif";
      this.fine_txt_height = 6;
      this.fine_txt_above = 2;
      this.fine_txt_font = "normal " + this.fine_txt_height + "px Helvetica, sans-serif";
      this.letter_metrics = new Array();
      this.summed_width = 0;
      this.summed_height = 0;
      //function prototypes
      //none
      //calculate the width of the y axis numbers
      ctx.font = this.y_num_font;
      for (var i = 0; i <= 2; i++) {
        this.y_num_width = Math.max(this.y_num_width, ctx.measureText("" + i).width);
      }
      //calculate the width of the x axis numbers (but they are rotated so it becomes height)
      ctx.font = this.x_num_font;
      for (var i = 1; i <= logo_columns; i++) {
        this.x_num_width = Math.max(this.x_num_width, ctx.measureText("" + i).width);
      }
      
      //calculate how much vertical space we want to draw this
      //first we add the padding at the top and bottom since that's always there
      this.summed_height += this.pad_top + this.pad_bottom;
      //all except the last row have the same amount of space allocated to them
      if (logo_rows > 1) {
        var row_height = this.stack_height + this.pad_middle;
        if (allow_space_for_names) {
          row_height += this.name_height;
          //the label is allowed to overlap into the spacer
          row_height += Math.max(this.y_num_height/2, this.name_spacer); 
          //the label is allowed to overlap the space used by the other label
          row_height += Math.max(this.y_num_height/2, this.x_num_height + this.x_num_above); 
        } else {
          row_height += this.y_num_height/2; 
          //the label is allowed to overlap the space used by the other label
          row_height += Math.max(this.y_num_height/2, this.x_num_height + this.x_num_above); 
        }
        this.summed_height += row_height * (logo_rows - 1);
      }
      //the last row has the name and fine text below it but no padding
      this.summed_height += this.stack_height + this.y_num_height/2;
      if (allow_space_for_names) {
        this.summed_height += this.fine_txt_height + this.fine_txt_above + this.name_height;
        this.summed_height += Math.max(this.y_num_height/2, this.x_num_height + this.x_num_above + this.name_spacer);
      } else {
        this.summed_height += Math.max(this.y_num_height/2, this.x_num_height + this.x_num_above + this.fine_txt_height + this.fine_txt_above);
      }

      //calculate how much horizontal space we want to draw this
      //first add the padding at the left and right since that's always there
      this.summed_width += this.pad_left + this.pad_right;
      //add on the space for the y-axis label
      this.summed_width += this.y_label_height + this.y_label_spacer;
      //add on the space for the y-axis
      this.summed_width += this.y_num_width + this.y_tic_width;
      //add on the space for the stacks
      this.summed_width += (this.stack_pad_left + this.stack_width) * logo_columns;
      //add on the padding after the stacks (an offset from the fine text)
      this.summed_width += this.stacks_pad_right;

      //calculate scaling factors
      this.scale_y = this.canvas_height / this.summed_height;
      this.scale_x = this.canvas_width / this.summed_width;

      //maintain aspect ratio
      if (this.scale_y > this.scale_x) {
        this.scale_y = this.scale_x;
      } else {
        this.scale_x = this.scale_y;
      }


    }

    //======================================================================
    // end LogoMetrics object
    //======================================================================


    //found this trick at http://talideon.com/weblog/2005/02/detecting-broken-images-js.cfm
    function image_ok(img) {
      // During the onload event, IE correctly identifies any images that
      // weren't downloaded as not complete. Others should too. Gecko-based
      // browsers act like NS4 in that they report this incorrectly.
      if (!img.complete) {
        return false;
      }
      // However, they do have two very useful properties: naturalWidth and
      // naturalHeight. These give the true size of the image. If it failed
      // to load, either of these should be zero.
      if (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) {
        return false;
      }
      // No other way of checking: assume it's ok.
      return true;
    }
      
    function supports_text(ctx) {
      if (!ctx.fillText) return false;
      if (!ctx.measureText) return false;
      return true;
    }

    //draws the scale, returns the width
    function draw_scale(ctx, metrics, alphabet_ic) {
      var tic_height = metrics.stack_height / alphabet_ic;
      ctx.save();
      ctx.lineWidth = 1.5;
      ctx.translate(metrics.y_label_height, metrics.y_num_height/2);
      //draw the axis label
      ctx.save();
      ctx.font = metrics.y_label_font;
      ctx.translate(0, metrics.stack_height/2);
      ctx.save();
      ctx.rotate(-(Math.PI / 2));
      ctx.textAlign = "center";
      ctx.fillText("bits", 0, 0);
      ctx.restore();
      ctx.restore();

      ctx.translate(metrics.y_label_spacer + metrics.y_num_width, 0);

      //draw the axis tics
      ctx.save();
      ctx.translate(0, metrics.stack_height);
      ctx.font = metrics.y_num_font;
      ctx.textAlign = "right";
      ctx.textBaseline = "middle";
      for (var i = 0; i <= alphabet_ic; i++) {
        //draw the number
        ctx.fillText("" + i, 0, 0);
        //draw the tic
        ctx.beginPath();
        ctx.moveTo(0, 0);
        ctx.lineTo(metrics.y_tic_width, 0);
        ctx.stroke();
        //prepare for next tic
        ctx.translate(0, -tic_height);
      }
      ctx.restore();

      ctx.translate(metrics.y_tic_width, 0);

      ctx.beginPath();
      ctx.moveTo(0, 0);
      ctx.lineTo(0, metrics.stack_height);
      ctx.stroke();

      ctx.restore();
    }

    function draw_stack_num(ctx, metrics, row_index) {
      ctx.save();
      ctx.font = metrics.x_num_font;
      ctx.translate(metrics.stack_width / 2, metrics.stack_height + metrics.x_num_above);
      ctx.save();
      ctx.rotate(-(Math.PI / 2));
      ctx.textBaseline = "middle"
      ctx.textAlign = "right"
      ctx.fillText("" + (row_index + 1), 0, 0);
      ctx.restore();
      ctx.restore();
    }

    function draw_stack(ctx, metrics, symbols, raster) {
      var preferred_pad = 0;
      var sym_min = 5;

      ctx.save();//1
      ctx.translate(0, metrics.stack_height);
      for (var i in symbols) {
        //exclude inherited properties and undefined properties
        if (!symbols.hasOwnProperty(i) || symbols[i] === undefined) continue;
        
        var sym = symbols[i];
        var sym_height = metrics.stack_height * sym.get_scale();
        
        var pad = preferred_pad;
        if (sym_height - pad < sym_min) {
          pad = Math.min(pad, Math.max(0, sym_height - sym_min));
        }
        sym_height -= pad;

        //translate to the correct position
        ctx.translate(0, -(pad/2 + sym_height));
        //draw
        raster.draw(ctx, sym.get_symbol(), 0, 0, metrics.stack_width, sym_height);
        //translate past the padding
        ctx.translate(0, -(pad/2));
      }
      ctx.restore();//1
    }

    //draws a stack of symbols
    function draw_stack_old(ctx, metrics, symbols) {
      var lpad = 2;
      var sym_min = 5;
      var pos = metrics.stack_height;
      for (var i in symbols) {
        //exclude inherited properties and undefined properties
        if (!symbols.hasOwnProperty(i) || symbols[i] === undefined) continue;
        
        var sym = symbols[i];
        var sym_height = metrics.stack_height*sym.get_scale();
        var letter = metrics.get_letter_metrics(sym.get_symbol());
        //attempting to draw something smaller than a pixel causes display corruption
        if (sym_height >= 1) {
          //it's better to see the letter than to pad it
          var pad = lpad;
          if (sym_height - pad < sym_min) {
            pad = Math.min(pad, Math.max(0, sym_height - sym_min));
          }
          //move to the correct drawing position
          ctx.save();//s1
          ctx.translate(0, pos);
          //create a clipping rectangle to ensure the letter doesn't overlap when it's distorted
          ctx.save();//s2
          //ctx.beginPath(); //disabled clipping because after the improvements in the text metrics it looks better without
          //ctx.moveTo(-metrics.stack_width/2,0);
          //ctx.lineTo(metrics.stack_width/2, 0);
          //ctx.lineTo(metrics.stack_width/2, -sym_height);
          //ctx.lineTo(-metrics.stack_width/2, -sym_height);
          //ctx.lineTo(-metrics.stack_width/2,0);
          //ctx.clip();
          //now draw
          ctx.translate(0, -(pad/2));
          ctx.translate(0, -letter.get_descent(sym_height - pad));
          ctx.fillStyle = sym.get_colour();
          ctx.textAlign = "center";
          ctx.save();//s3
          ctx.scale(letter.wscale, letter.get_hscale(sym_height - pad));
          ctx.fillText(sym.get_symbol(), 0, 0);
          ctx.restore();//s3

          ctx.restore();//s2
          ctx.restore();//s1
        }

        pos = pos - sym_height;
      }
    }
    
    function draw_dashed_line(ctx, pattern, start, x1, y1, x2, y2) {
        var x, y, len, i;
        var dx = x2 - x1;
        var dy = y2 - y1;
        var tlen = Math.pow(dx*dx + dy*dy, 0.5);
        var theta = Math.atan2(dy,dx);
        var mulx = Math.cos(theta);
        var muly = Math.sin(theta);
        var lx = [];
        var ly = [];
        for (i = 0; i < pattern; ++i) {
          lx.push(pattern[i] * mulx);
          ly.push(pattern[i] * muly);
        }
        i = start;
        x = x1;
        y = y1;
        len = 0;
        ctx.beginPath();
        while (len + pattern[i] < tlen) {
          ctx.moveTo(x, y);
          x += lx[i];
          y += ly[i];
          ctx.lineTo(x, y);
          len += pattern[i];
          i = (i + 1) % pattern.length;
          x += lx[i];
          y += ly[i];
          len += pattern[i];
          i = (i + 1) % pattern.length;
        }
        if (len < tlen) {
          ctx.moveTo(x, y);
          x += mulx * (tlen - len);
          y += muly * (tlen - len);
          ctx.lineTo(x, y);
        }
        ctx.stroke();
    }

    function draw_trim_background(ctx, metrics, pspm, offset) {
      var lwidth = metrics.stack_width * pspm.get_left_trim();
      var rwidth = metrics.stack_width * pspm.get_right_trim();
      var mwidth = metrics.stack_width * pspm.get_motif_length();
      var rstart = mwidth - rwidth;
      ctx.save();//s8
      ctx.translate(offset * metrics.stack_width, 0);
      ctx.fillStyle = "rgb(240, 240, 240)";
      if (pspm.get_left_trim() > 0) ctx.fillRect(0, 0, lwidth, metrics.stack_height);
      if (pspm.get_right_trim() > 0) ctx.fillRect(rstart, 0, rwidth, metrics.stack_height);
      ctx.fillStyle = "rgb(51, 51, 51)";
      if (pspm.get_left_trim() > 0) draw_dashed_line(ctx, [3], 0, lwidth-0.5, 0, lwidth-0.5,  metrics.stack_height);
      if (pspm.get_right_trim() > 0) draw_dashed_line(ctx, [3], 0, rstart+0.5, 0, rstart+0.5,  metrics.stack_height);
      ctx.restore();//s8
    }

    function draw_logo_on_canvas(logo, canvas, show_names, scale) {
      var draw_name = (typeof show_names == "boolean" ? show_names : (logo.get_rows() > 1));
      var cwidth = canvas.width;
      var cheight = canvas.height;
      //need a minimum 46 x 120 canvas to draw the font size checks on
      if (canvas.width < 46) canvas.width = 46;
      if (canvas.height < 120) canvas.height = 120;
      var ctx = canvas.getContext('2d');
      //assume that the user wants the canvas scaled equally so calculate what the best width for this image should be
      var metrics = new LogoMetrics(ctx, canvas.width, canvas.height, logo.get_columns(), logo.get_rows(), draw_name);
      ctx.save();//s1
      if (typeof scale == "number") {
        //resize the canvas to fit the scaled logo
        cwidth = metrics.summed_width * scale;
        cheight = metrics.summed_height * scale;
      } else {
        if (cwidth == 0 || cheight == 0 || scale == 0) {
          throw "CANVAS_MUST_HAVE_DIMENSIONS";
        }
        scale = Math.min(cwidth / metrics.summed_width, cheight / metrics.summed_height);
      }
      var raster = new RasterizedAlphabet(logo.alphabet, metrics.stack_font, metrics.stack_width * scale * 2);
      if (cwidth != canvas.width || cheight != canvas.height) {
        canvas.width = cwidth;
        canvas.height = cheight;
        //as the canvas has been resized the context is now out of date
        ctx = canvas.getContext('2d');
      }
      ctx.scale(scale, scale);
      ctx.save();//s2
      ctx.save();//s7
      //create margin
      ctx.translate(metrics.pad_left, metrics.pad_top);
      for (var pspm_i = 0; pspm_i < logo.get_rows(); ++pspm_i) {
        var pspm = logo.get_pspm(pspm_i);
        var offset = logo.get_offset(pspm_i);
        //optionally draw name if this isn't the last row or is the only row 
        if (draw_name && (logo.get_rows() == 1 || pspm_i != (logo.get_rows()-1))) {
          ctx.save();//s4
          ctx.translate(metrics.summed_width/2, metrics.name_height);
          ctx.font = metrics.name_font;
          ctx.textAlign = "center";
          ctx.fillText(pspm.name, 0, 0);
          ctx.restore();//s4
          ctx.translate(0, metrics.name_height + Math.min(0, metrics.name_spacer - metrics.y_num_height/2));
        }
        //draw scale
        draw_scale(ctx, metrics, logo.alphabet.get_ic());
        ctx.save();//s5
        //translate across past the scale
        ctx.translate(metrics.y_label_height + metrics.y_label_spacer + 
            metrics.y_num_width + metrics.y_tic_width, 0);
        //draw the trimming background
        if (pspm.get_left_trim() > 0 || pspm.get_right_trim() > 0) {
          draw_trim_background(ctx, metrics, pspm, offset);
        }
        //draw letters
        ctx.translate(0, metrics.y_num_height / 2);
        for (var col_index = 0; col_index < logo.get_columns(); col_index++) {
          ctx.translate(metrics.stack_pad_left,0);
          if (col_index >= offset && col_index < (offset + pspm.get_motif_length())) {
            var motif_position = col_index - offset;
            draw_stack_num(ctx, metrics, motif_position);
            draw_stack(ctx, metrics, pspm.get_stack(motif_position, logo.alphabet), raster);
          }
          ctx.translate(metrics.stack_width, 0);
        }
        ctx.restore();//s5
        ////optionally draw name if this is the last row but isn't the only row 
        if (draw_name && (logo.get_rows() != 1 && pspm_i == (logo.get_rows()-1))) {
          //translate vertically past the stack and axis's        
          ctx.translate(0, metrics.y_num_height/2 + metrics.stack_height + 
              Math.max(metrics.y_num_height/2, metrics.x_num_above + metrics.x_num_width + metrics.name_spacer));

          ctx.save();//s6
          ctx.translate(metrics.summed_width/2, metrics.name_height);
          ctx.font = metrics.name_font;
          ctx.textAlign = "center";
          ctx.fillText(pspm.name, 0, 0);
          ctx.restore();//s6
          ctx.translate(0, metrics.name_height);
        } else {
          //translate vertically past the stack and axis's        
          ctx.translate(0, metrics.y_num_height/2 + metrics.stack_height + Math.max(metrics.y_num_height/2, metrics.x_num_above + metrics.x_num_width));
        }
        //if not the last row then add middle padding
        if (pspm_i != (logo.get_rows() -1)) {
          ctx.translate(0, metrics.pad_middle);
        }
      }
      ctx.restore();//s7
      ctx.translate(metrics.summed_width - metrics.pad_right, metrics.summed_height - metrics.pad_bottom);
      ctx.font = metrics.fine_txt_font;
      ctx.textAlign = "right";
      ctx.fillText(logo.fine_text, 0,0);
      ctx.restore();//s2
      ctx.restore();//s1
    }

    function create_canvas(c_width, c_height, c_id, c_title, c_display) {
      var canvas = document.createElement("canvas");
      //check for canvas support before attempting anything
      if (!canvas.getContext) return null;
      var ctx = canvas.getContext('2d');
      //check for html5 text drawing support
      if (!supports_text(ctx)) return null;
      //size the canvas
      canvas.width = c_width;
      canvas.height = c_height;
      canvas.id = c_id;
      canvas.title = c_title;
      canvas.style.display = c_display;
      return canvas;
    }

    function logo_1(alphabet, fine_text, pspm) {
      var logo = new Logo(alphabet, fine_text);
      logo.add_pspm(pspm);
      return logo;
    }
    
    function logo_2(alphabet, fine_text, target, query, query_offset) {
      var logo = new Logo(alphabet, fine_text);
      if (query_offset < 0) {
        logo.add_pspm(target, -query_offset);
        logo.add_pspm(query);
      } else {
        logo.add_pspm(target);
        logo.add_pspm(query, query_offset);
      }      
      return logo;
    }

    /*
     * Specifies an alternate source for an image.
     * If the image with the image_id specified has
     * not loaded then a generated logo will be used 
     * to replace it.
     *
     * Note that the image must either have dimensions
     * or a scale must be set.
     */
    function alternate_logo(logo, image_id, scale) {
      var image = document.getElementById(image_id);
      if (!image) {
        alert("Can't find specified image id (" +  image_id + ")");
        return;
      }
      //if the image has loaded then there is no reason to use the canvas
      if (image_ok(image)) return;
      //the image has failed to load so replace it with a canvas if we can.
      var canvas = create_canvas(image.width, image.height, image_id, image.title, image.style.display);
      if (canvas == null) return;
      //draw the logo on the canvas
      draw_logo_on_canvas(logo, canvas, undefined, scale);
      //replace the image with the canvas
      image.parentNode.replaceChild(canvas, image);
    }

    /*
     * Specifes that the element with the specified id
     * should be replaced with a generated logo.
     */
    function replace_logo(logo, replace_id, scale, title_txt, display_style) {
      var element = document.getElementById(replace_id);
      if (!replace_id) {
        alert("Can't find specified id (" + replace_id + ")");
        return;
      }
      //found the element!
      var canvas = create_canvas(50, 120, replace_id, title_txt, display_style);
      if (canvas == null) return;
      //draw the logo on the canvas
      draw_logo_on_canvas(logo, canvas, undefined, scale);
      //replace the element with the canvas
      element.parentNode.replaceChild(canvas, element);
    }

    /* END INCLUDED FILE "motif_logo.js" */
    
  
        function setup() {
          var motif_count = 1;
          //create canvas logos
          var alphabet = new Alphabet(document.getElementById("alphabet").value, document.getElementById("bgfreq").value);
          for (var i = 1; i <= motif_count; i++) {
            var pspm = new Pspm(document.getElementById("pspm" + i).value);
            var logo = logo_1(alphabet, "MEME", pspm);
            alternate_logo(logo, "thumbnail_logo_" + i, 0.5);
            alternate_logo(logo, "logo_img_" + i, 1);
          
          }
          
          //ensure radio buttons have data generated for them by fireing events
          var allInputs = document.getElementsByTagName("input");
          for (var i = 0; i < allInputs.length; i++) {
            var input = allInputs[i];
            if (input.type == "radio" && input.checked) {
              var evt = document.createEvent("MouseEvents");
              evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
              input.dispatchEvent(evt);
            }
          }
          
          for (var i = 1; i <= motif_count; i++) {
            tbl = document.getElementById("tbl_sites_" + i);
            wireUpTable(tbl, false);
            tbl = document.getElementById("tbl_blocks_" + i);
            wireUpTable(tbl, true);
          }
        }
        function showDesc(source, targetid) {
          document.getElementById(targetid).childNodes[0].nodeValue = source.title;
        }
        function hideDesc(targetid) {
          document.getElementById(targetid).childNodes[0].nodeValue = "Mouse-over buttons for more information.";
        }
        function showEmbededFormat(motifnum, format) {
          var source = document.getElementById(format + motifnum);
          var txtarea = document.getElementById("format_display_area_" + motifnum);
          txtarea.value = source.value;
          txtarea.style.display = 'block';
        }
        function hideFormat(motifnum) {
          var txtarea = document.getElementById("format_display_area_" + motifnum);
          txtarea.style.display = 'none';
        }
        function block2raw(block) {
          var raw = "";
          var endpat = /\/\//;
          var wordpat = /\S+/gi;
          var lines = block.split("\n");
          for (i = 2; i < lines.length; ++i) {
            if (lines[i].match(endpat) != null) break;
            var words = lines[i].match(wordpat);
            raw += words[3] + "\n";
          }
          return raw;
        }
        function block2fasta(block) {
          var fasta = "";
          var endpat = /\/\//;
          var wordpat = /\S+/gi;
          var lines = block.split("\n");
          for (i = 2; i < lines.length; ++i) {
            if (lines[i].match(endpat) != null) break;
            var words = lines[i].match(wordpat);
            var start = words[2].substring(0, words[2].length - 1);
            fasta += ">" + words[0] + " ( start= " + start + " )\n" + words[3] + "\n";
          }
          return fasta;
        }
        function showRaw(motifnum) {
          var source = document.getElementById('blocks' + motifnum);
          var txtarea = document.getElementById("format_display_area_" + motifnum);
          txtarea.value = block2raw(source.value);
          txtarea.style.display = 'block';
        }
        function showFasta(motifnum) {
          var source = document.getElementById('blocks' + motifnum);
          var txtarea = document.getElementById("format_display_area_" + motifnum);
          txtarea.value = block2fasta(source.value);
          txtarea.style.display = 'block';
        }
        function showHidden(prefix) {
          document.getElementById(prefix + '_activator').style.display = 'none';
          document.getElementById(prefix + '_deactivator').style.display = 'block';
          document.getElementById(prefix + '_data').style.display = 'block';
        }
        function hideShown(prefix) {
          document.getElementById(prefix + '_activator').style.display = 'block';
          document.getElementById(prefix + '_deactivator').style.display = 'none';
          document.getElementById(prefix + '_data').style.display = 'none';
        }
        function wireUpTable(table, skiplast) {
          if (table && table.rows) {
            var nRows = table.rows.length;
            if (skiplast) {nRows--;}
            for (var i = 1; i < nRows; i++) {
              var row = table.rows[i];
              row.style.cursor = 'pointer';
              row.onclick = function()
              {
                processHighlight(this);
              }
            }
          } else {
            alert(table);
          }
        }
        function processHighlight(sourceRow) {
          var name = sourceRow.cells[0].firstChild.nodeValue;
          
          for (var i = 1; i <= 1; i++) {
            tbl = document.getElementById("tbl_sites_" + i);
            highlightTable(name, tbl);
            tbl = document.getElementById("tbl_blocks_" + i);
            highlightTable(name, tbl);
          }
        }
        function highlightTable(name, table) {
          if (table == null) return;
          nRows = table.rows.length;
          for (var i = 0; i < nRows; i++) {
            var row = table.rows[i];
            if(row.cells[0].firstChild.nodeValue == name) {
              row.style.backgroundColor = "#aaffaa";
            } else {
              row.style.backgroundColor = "white";
            }
          }
        }
        function warnExternal() {
          if (confirm("Using BLOCKS requires the data to be sent to an external webservice even if you have setup your own meme installation. Continue?")) {
            return true;
          }
          return false;
        }
        function clickLogoTab(is_rc, num) {
          var stdTab = document.getElementById("logo_tab_std_" + num);
          var rcTab = document.getElementById("logo_tab_rc_" + num);
          var logoImg = document.getElementById("logo_img_" + num);
          var logoRcImg = document.getElementById("logo_rc_img_" + num);
          if (is_rc) {
            logoImg.style.display = 'none';
            logoRcImg.style.display = 'block';
            rcTab.setAttribute("class", "tab activeTab");
            stdTab.setAttribute("class", "tab");
          } else {
            logoRcImg.style.display = 'none';
            logoImg.style.display = 'block';
            rcTab.setAttribute("class", "tab");
            stdTab.setAttribute("class", "tab activeTab");
          }
        }
      </script>
</head>
<body onload="javascript:setup()"><form enctype="application/x-www-form-urlencoded" method="post" target="_new" action="http://h4evr-laptop/meme/cgi-bin/meme_request.cgi">
<!--+++++++++++++++++++++++START DATA+++++++++++++++++++++++++++++++++++++-->
<input type="hidden" name="version" value="MEME version 4.6.0">
<input type="hidden" name="alphabet" id="alphabet" value="ACDEFGHIKLMNPQRSTVWY">
<input type="hidden" name="strands" value="none">
<input type="hidden" name="bgfreq" id="bgfreq" value="A 0.073 C 0.017 D 0.055 E 0.065 F 0.045 G 0.067 H 0.021 I 0.067 K 0.071 
L 0.092 M 0.030 N 0.041 P 0.042 Q 0.036 R 0.048 S 0.067 T 0.059 V 0.067 
W 0.012 Y 0.026">
<input type="hidden" name="name" value="21727.pos.fasta">
<input type="hidden" name="combinedblock" value="
gi|40764015|gb|AAR89637.1| 1.24e-03 7 1440 1 207 8.63e-07 1 331 8.63e-07 1 455 8.63e-07 1 579 8.63e-07 1 703 2.15e-05 1 828 8.63e-07 1 952 1.13e-05 
gi|37702021|gb|AAR00672.1| 3.68e-06 1 1249 1 587 2.96e-09 
gi|46452276|gb|AAS98221.1| 3.69e-04 1 632 1 511 5.90e-07 
gi|37702019|gb|AAR00671.1| 3.69e-06 1 1252 1 590 2.96e-09 
gi|5323|emb|CAA42376.1| 2.40e-03 1 500 1 447 4.88e-06 
gi|46452280|gb|AAS98223.1| 3.25e-04 1 558 1 437 5.90e-07 
gi|41020884|gb|AAR98633.1| 6.13e-06 1 498 1 160 1.25e-08 
gi|33188217|gb|AAP97871.1| 6.74e-03 1 322 1 76 2.15e-05 
gi|75288178|gb|ABA18179.1| 8.23e-05 1 1161 1 474 7.13e-08 
gi|40764042|gb|AAR89639.1| 8.57e-04 2 1327 1 347 6.50e-07 1 790 9.30e-05 
gi|40763973|gb|AAR89634.1| 9.54e-08 2 545 1 170 1.77e-10 1 224 7.31e-05 
gi|115528964|gb|AAI10506.2| 2.95e-03 1 917 1 884 3.25e-06 
gi|41020960|gb|AAR98636.1| 6.11e-07 1 554 1 162 1.12e-09 
gi|41020924|gb|AAR98635.1| 9.37e-06 1 510 1 168 1.86e-08 
gi|37702017|gb|AAR00670.1| 1.85e-03 1 627 1 235 2.99e-06 
">
<input type="hidden" name="nmotifs" value="1">
<!--data for motif 1-->
<input type="hidden" id="motifblock1" name="motifblock1" value="
BL   MOTIF 1 width=8 seqs=15
">
<input type="hidden" id="pssm1" name="pssm1" value="
log-odds matrix: alength= 20 w= 8 n= 15 bayes= 9.64049 E= 1.1e-005
-375 580 -532 -500 -489 -538 -448 -443 -564 -481 -421 -475 -517 -488 -315 -456 -396 -472 -522 -502 
2 -284 97 32 160 108 -88 -297 23 -262 166 -89 -218 -40 50 -110 17 -237 -277 -192 
-207 -193 -458 -393 55 68 -255 -119 -381 -125 385 -324 -361 -298 -326 -273 -207 148 221 -140 
-139 -287 -152 -95 -313 -246 -101 -300 126 -67 -216 141 -232 92 -99 15 211 -242 -286 183 
-516 -410 -606 -610 367 -582 -219 -385 -581 -342 -373 -446 -548 -446 -487 -495 -498 215 -135 179 
19 -205 -445 -402 -315 237 -327 -244 -404 -268 106 -333 -357 -323 -361 94 108 146 -339 -302 
-5 -297 -159 17 -336 -254 -133 -322 -138 16 -250 143 249 -93 -150 192 -172 -265 -319 -238 
-212 -230 94 -270 -95 -338 -144 -196 -272 40 -182 -224 -331 -216 -255 -9 8 -169 443 320 

">
<input type="hidden" id="pspm1" name="pspm1" value="
letter-probability matrix: alength= 20 w= 8 nsites= 15 E= 1.1e-005
0.000000 0.933333 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.066667 0.000000 0.000000 0.000000 0.000000 0.000000 
0.066667 0.000000 0.133333 0.066667 0.200000 0.200000 0.000000 0.000000 0.066667 0.000000 0.133333 0.000000 0.000000 0.000000 0.066667 0.000000 0.066667 0.000000 0.000000 0.000000 
0.000000 0.000000 0.000000 0.000000 0.066667 0.133333 0.000000 0.000000 0.000000 0.000000 0.533333 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.200000 0.066667 0.000000 
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.200000 0.066667 0.000000 0.133333 0.000000 0.066667 0.000000 0.066667 0.333333 0.000000 0.000000 0.133333 
0.000000 0.000000 0.000000 0.000000 0.600000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.333333 0.000000 0.066667 
0.066667 0.000000 0.000000 0.000000 0.000000 0.400000 0.000000 0.000000 0.000000 0.000000 0.066667 0.000000 0.000000 0.000000 0.000000 0.133333 0.133333 0.200000 0.000000 0.000000 
0.066667 0.000000 0.000000 0.066667 0.000000 0.000000 0.000000 0.000000 0.000000 0.133333 0.000000 0.133333 0.266667 0.000000 0.000000 0.333333 0.000000 0.000000 0.000000 0.000000 
0.000000 0.000000 0.133333 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.133333 0.000000 0.000000 0.000000 0.000000 0.000000 0.066667 0.066667 0.000000 0.333333 0.266667 

">
<input type="hidden" id="blocks1" name="BLOCKS1" value="
BL   MOTIF 1 width=8 seqs=15
gi|40763973|gb|AAR89634.1|  ( 170) CRMTFGSW 1
gi|41020960|gb|AAR98636.1|  ( 162) CTMKFGSW 1
gi|37702019|gb|AAR00671.1|  ( 590) CMMTVVPY 1
gi|37702021|gb|AAR00672.1|  ( 587) CMMTVVPY 1
gi|41020884|gb|AAR98633.1|  ( 160) CFFKFGSW 1
gi|41020924|gb|AAR98635.1|  ( 168) CFVTFASW 1
gi|75288178|gb|ABA18179.1|  ( 474) CFMYFGLL 1
gi|46452280|gb|AAS98223.1|  ( 437) CGMNVSND 1
gi|46452276|gb|AAS98221.1|  ( 511) CGMNVSND 1
gi|40764042|gb|AAR89639.1|  ( 347) CGMLYGAY 1
gi|40764015|gb|AAR89637.1|  ( 207) CKVYFTPL 1
gi|37702017|gb|AAR00670.1|  ( 235) CEGKFTPT 1
gi|115528964|gb|AAI10506.2|  ( 884) CDVTFMLS 1
gi|5323|emb|CAA42376.1|  ( 447) CDGSVVEY 1
gi|33188217|gb|AAP97871.1|  ( 76) RAWQFGSW 1
//

">
<!--++++++++++++++++++++++++++++FINISHED DATA++++++++++++++++++++++++++++++++-->
<a name="top_buttons"></a><div class="pad1">
<h1><img src="http://meme.nbcr.net/meme/images/meme.png" alt="MEME"></h1>
<p class="spaced">
        For further information on how to interpret these results or to get a 
        copy of the MEME software please access 
        <a href="http://meme.nbcr.net/">http://meme.nbcr.net</a>. 
      </p>
</div>
<div class="pad2">
<a class="jump" href="#overview">Discovered Motifs</a>
        |  
      <a class="jump" href="#combined">Block diagrams of Motifs</a>
        |  
      <a class="jump" href="#version">Program information</a>
        |  
      <a class="jump" href="#explanation">Explanation</a>
</div>
<a name="overview"></a><h2 class="mainh pad2">Discovered Motifs</h2>
<div class="box">
<h4>Motif Overview</h4>
<div class="pad"><table>
<col style="text-align: center">
<col style="text-align: right">
<col style="text-align: right">
<col>
<tbody><tr>
<td><a href="#motif_1">Motif 1</a></td>
<td style="padding-left:20px"><ul>
<li>1.1e-005</li>
<li>15 sites</li>
</ul></td>
<td style="padding-left:20px"></td>
<td style="padding-left:20px;"><a href="#motif_1"><img style="display:block; height:75px" src="logo1.png" id="thumbnail_logo_1" alt="Motif 1 Logo"></a></td>
</tr></tbody>
</table></div>
<h4>Further Analysis</h4>
<div class="pad">
        Submit all motifs to 
        <input name="do_MAST_all" value="MAST" type="submit" title="Search sequence databases for the best combined matches with these motifs using MAST." onmouseover="javascript:showDesc(this, 'overview_action_desc')" onmouseout="javascript:hideDesc('overview_action_desc')"> 
        <a href="#MAST_doc" title="Click for more information on MAST." class="help"><div class="help"></div></a>
            
        <input name="do_FIMO_all" value="FIMO" type="submit" title="Search sequence databases for all matches with these motifs using FIMO." onmouseover="javascript:showDesc(this, 'overview_action_desc')" onmouseout="javascript:hideDesc('overview_action_desc')"> 
        <a href="#FIMO_doc" title="Click for more information on FIMO." class="help"><div class="help"></div></a>
            
        <input name="do_BLOCKS_all" value="BLOCKS" type="submit" title="Submit these motifs to BLOCKS multiple alignment processor." onclick="return warnExternal()" onmouseover="javascript:showDesc(this, 'overview_action_desc')" onmouseout="javascript:hideDesc('overview_action_desc')"> 
        <a href="#BLOCKS_doc" title="Click for more information on BLOCKS." class="help"><div class="help"></div></a>
         <span id="overview_action_desc">Mouse-over buttons for more information.</span>
</div>
</div>
<a name="motif_1"></a><table width="100%" border="0" cellspacing="1" cellpadding="4" bgcolor="#FFFFFF"><tr>
<td><h2 class="mainh">Motif 1</h2></td>
<td align="right" valign="bottom"><a href="#top_buttons">Top</a></td>
</tr></table>
<div class="box">
<table style="width:100%; background-color:#ddddff">
<tr>
<th class="majorth"><h4>Summary <a href="#summary_doc"><div class="help"></div></a>
</h4></th>
<th class="majorth"><h4>Sequence Logo <a href="#logo_doc"><div class="help"></div></a>
</h4></th>
</tr>
<tr>
<td style="width:15em; vertical-align:text-top;">
<table style="width:100%; " cellspacing="0">
<col>
<col style="text-align:left;">
<tr>
<th class="minorth">E-value</th>
<td>1.1e-005</td>
</tr>
<tr>
<th class="minorth">Width</th>
<td>8</td>
</tr>
<tr>
<th class="minorth">Sites</th>
<td>15</td>
</tr>
</table>
<a href="javascript:showHidden('summary_extra_1')" id="summary_extra_1_activator">show more</a><div id="summary_extra_1_data" style="display:none"><table style="width:100%;" cellspacing="0">
<tr><th colspan="2" class="minorth">Log Likelihood Ratio <a href="#llr_doc"><div class="help"></div></a>
</th></tr>
<tr>
<td style="width:8em;"> </td>
<td>214</td>
</tr>
<tr><th colspan="2" class="minorth">Information Content <a href="#ic_doc"><div class="help"></div></a>
</th></tr>
<tr>
<td> </td>
<td>18.6 (bits)</td>
</tr>
<tr><th colspan="2" class="minorth">Relative Entropy <a href="#re_doc"><div class="help"></div></a>
</th></tr>
<tr>
<td> </td>
<td>20.6 (bits)</td>
</tr>
</table></div>
<a href="javascript:hideShown('summary_extra_1')" id="summary_extra_1_deactivator" style="display:none;">show less</a>
</td>
<td>
<div class="tabMain"><img src="logo1.png" style="display:block;" id="logo_img_1" height="140" width="200" alt="PNG LOGOS require CONVERT from ImageMagick; see MEME installation guide"></div>
<div class="tabArea"><a id="logo_tab_std_1" href="javascript:clickLogoTab(false,1)" class="tab activeTab">Standard</a></div>
<br>
          Download LOGO <a href="#download_doc" class="help"><div class="help"></div></a>
            
          Orientation:
          <select name="logorc_1"><option value="false">standard</option>
<option value="true" disabled>reverse complement</option></select>
            
          SSC:
          <select name="logossc_1"><option value="false">off</option>
<option value="true">on</option></select>
            
          Format:
          <select name="logoformat_1"><option value="png">web (png)</option>
<option value="eps">publication (eps)</option></select>
            
          Width: 
          <input type="text" size="2" maxlength="5" value="8" title="Width of logo in cm." name="logowidth_1"> cm 
            
          Height: 
          <input type="text" size="2" maxlength="5" value="7.5" title="Height of logo in cm." name="logoheight_1"> cm 
            
          <input type="submit" value="Download" title="Download a logo" name="do_LOGO_1">
</td>
</tr>
</table>
<h4>Regular expression <a href="#regular_expression_doc" class="help"><div class="help"></div></a>
</h4>
<p class="pad">
C[FG][MV][TK][FV][GV][SP][WY]
</p>
<h4>Further Analysis <a href="#further_analysis_doc" class="help"><div class="help"></div></a>
</h4>
<div class="pad">
      Submit this motif to
      <input type="submit" name="do_MAST_1" value="MAST" title="Scan sequence databases for the best match in each sequence using MAST." onmouseover="javascript:showDesc(this, 'motif1_action_desc')" onmouseout="javascript:hideDesc('motif1_action_desc')"> 
      <a href="#MAST_doc" title="Click for more information on MAST." class="help"><div class="help"></div></a>
          
      <input type="submit" name="do_FIMO_1" value="FIMO" title="Scan sequence databases for all matches with this motif using FIMO." onmouseover="javascript:showDesc(this, 'motif1_action_desc')" onmouseout="javascript:hideDesc('motif1_action_desc')"> 
      <a href="#FIMO_doc" title="Click for more information on FIMO." class="help"><div class="help"></div></a>
          
      <input type="submit" name="do_BLOCKS_1" value="BLOCKS" title="Submit this motif to BLOCKS multiple alignment processor." onclick="return warnExternal()" onmouseover="javascript:showDesc(this, 'motif1_action_desc')" onmouseout="javascript:hideDesc('motif1_action_desc')"> 
      <a href="#BLOCKS_doc" title="Click for more information on BLOCKS." class="help"><div class="help"></div></a>
       <span id="motif1_action_desc">Mouse-over buttons for more information.</span>
</div>
<h4>Data Formats <a href="#formats_doc" class="help"><div class="help"></div></a>
</h4>
<div class="pad">
      View the motif in 
      <input name="format_display_1" type="radio" onclick="javascript:showEmbededFormat(1, 'pspm')">PSPM Format 
      <a href="#format_PSPM_doc" title="Click for more information on PSPMs." class="help"><div class="help"></div></a>
          
      <input name="format_display_1" type="radio" onclick="javascript:showEmbededFormat(1, 'pssm')">PSSM Format 
      <a href="#format_PSSM_doc" title="Click for more information on PSSMs." class="help"><div class="help"></div></a>
          
      <input name="format_display_1" type="radio" onclick="javascript:showEmbededFormat(1, 'blocks')">BLOCKS Format 
      <a href="#format_BLOCKS_doc" title="Click for more information on BLOCKS format." class="help"><div class="help"></div></a>
          
      <input name="format_display_1" type="radio" onclick="javascript:showFasta(1)">FASTA Format 
      <a href="#format_FASTA_doc" title="Click for more information on FASTA format." class="help"><div class="help"></div></a>
          
      <input name="format_display_1" type="radio" onclick="javascript:showRaw(1)">Raw Format 
      <a href="#format_raw_doc" title="Click for more information on raw format." class="help"><div class="help"></div></a>
          
      or
      <input name="format_display_1" type="radio" onclick="javascript:hideFormat(1)" checked>Hide<br><textarea id="format_display_area_1" rows="20" style="display:none; width:100%;" readonly></textarea><noscript>This feature requires javascript.</noscript>
</div>
<h4>Sites <a href="#sites_doc" class="help"><div class="help"></div></a>
</h4>
<div class="pad">
<p>Click on any row to highlight sequence in all motifs.</p>
<table id="tbl_sites_1" cellpadding="0.5cm">
<col style="">
<col style="">
<col style="">
<col style="">
<col style="">
<col style="">
<thead><tr>
<th>Name <a name="sites1"></a>
</th>
<th>Start</th>
<th>
<i>p</i>-value</th>
<th colspan="3">Sites <a href="#sites_doc" class="help"><div class="help"></div></a>
</th>
</tr></thead>
<tbody>
<tr>
<td class="strand_name">gi|40763973|gb|AAR89634.1|</td>
<td class="strand_start">170</td>
<td class="strand_pvalue">1.77e-10</td>
<td class="strand_lflank">LKYFPFDTQT</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:red;">R</span><span style="color:blue;">M</span><span style="color:green;">T</span><span style="color:blue;">F</span><span style="color:orange;">G</span><span style="color:green;">S</span><span style="color:blue;">W</span>
</td>
<td class="strand_rflank">SFDNSLIDYF</td>
</tr>
<tr>
<td class="strand_name">gi|41020960|gb|AAR98636.1|</td>
<td class="strand_start">162</td>
<td class="strand_pvalue">1.12e-09</td>
<td class="strand_lflank">IAYFPFDTQH</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:green;">T</span><span style="color:blue;">M</span><span style="color:red;">K</span><span style="color:blue;">F</span><span style="color:orange;">G</span><span style="color:green;">S</span><span style="color:blue;">W</span>
</td>
<td class="strand_rflank">TYSGFFTDLI</td>
</tr>
<tr>
<td class="strand_name">gi|37702019|gb|AAR00671.1|</td>
<td class="strand_start">590</td>
<td class="strand_pvalue">2.96e-09</td>
<td class="strand_lflank">KVYTFNSSRK</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:blue;">M</span><span style="color:blue;">M</span><span style="color:green;">T</span><span style="color:blue;">V</span><span style="color:blue;">V</span><span style="color:yellow;">P</span><span style="color:turquoise;">Y</span>
</td>
<td class="strand_rflank">AENGQNIGYR</td>
</tr>
<tr>
<td class="strand_name">gi|37702021|gb|AAR00672.1|</td>
<td class="strand_start">587</td>
<td class="strand_pvalue">2.96e-09</td>
<td class="strand_lflank">KVYTFNSSRK</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:blue;">M</span><span style="color:blue;">M</span><span style="color:green;">T</span><span style="color:blue;">V</span><span style="color:blue;">V</span><span style="color:yellow;">P</span><span style="color:turquoise;">Y</span>
</td>
<td class="strand_rflank">AENGQNIGYR</td>
</tr>
<tr>
<td class="strand_name">gi|41020884|gb|AAR98633.1|</td>
<td class="strand_start">160</td>
<td class="strand_pvalue">1.25e-08</td>
<td class="strand_lflank">IQWFPFDEQK</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:blue;">F</span><span style="color:blue;">F</span><span style="color:red;">K</span><span style="color:blue;">F</span><span style="color:orange;">G</span><span style="color:green;">S</span><span style="color:blue;">W</span>
</td>
<td class="strand_rflank">TYDGYKLDLQ</td>
</tr>
<tr>
<td class="strand_name">gi|41020924|gb|AAR98635.1|</td>
<td class="strand_start">168</td>
<td class="strand_pvalue">1.86e-08</td>
<td class="strand_lflank">LQQFPFDQQI</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:blue;">F</span><span style="color:blue;">V</span><span style="color:green;">T</span><span style="color:blue;">F</span><span style="color:blue;">A</span><span style="color:green;">S</span><span style="color:blue;">W</span>
</td>
<td class="strand_rflank">SMDGSKLDLS</td>
</tr>
<tr>
<td class="strand_name">gi|75288178|gb|ABA18179.1|</td>
<td class="strand_start">474</td>
<td class="strand_pvalue">7.13e-08</td>
<td class="strand_lflank">AFNLQCLASI</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:blue;">F</span><span style="color:blue;">M</span><span style="color:turquoise;">Y</span><span style="color:blue;">F</span><span style="color:orange;">G</span><span style="color:blue;">L</span><span style="color:blue;">L</span>
</td>
<td class="strand_rflank">APIVTFGGLL</td>
</tr>
<tr>
<td class="strand_name">gi|46452280|gb|AAS98223.1|</td>
<td class="strand_start">437</td>
<td class="strand_pvalue">5.90e-07</td>
<td class="strand_lflank">RDDSFRVSIG</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:orange;">G</span><span style="color:blue;">M</span><span style="color:green;">N</span><span style="color:blue;">V</span><span style="color:green;">S</span><span style="color:green;">N</span><span style="color:magenta;">D</span>
</td>
<td class="strand_rflank">KPTMCLNDML</td>
</tr>
<tr>
<td class="strand_name">gi|46452276|gb|AAS98221.1|</td>
<td class="strand_start">511</td>
<td class="strand_pvalue">5.90e-07</td>
<td class="strand_lflank">RDDSFRVSIG</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:orange;">G</span><span style="color:blue;">M</span><span style="color:green;">N</span><span style="color:blue;">V</span><span style="color:green;">S</span><span style="color:green;">N</span><span style="color:magenta;">D</span>
</td>
<td class="strand_rflank">KPTMCLNDML</td>
</tr>
<tr>
<td class="strand_name">gi|40764042|gb|AAR89639.1|</td>
<td class="strand_start">347</td>
<td class="strand_pvalue">6.50e-07</td>
<td class="strand_lflank">FFFWLFSFLG</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:orange;">G</span><span style="color:blue;">M</span><span style="color:blue;">L</span><span style="color:turquoise;">Y</span><span style="color:orange;">G</span><span style="color:blue;">A</span><span style="color:turquoise;">Y</span>
</td>
<td class="strand_rflank">LLKVGIITTP</td>
</tr>
<tr>
<td class="strand_name">gi|40764015|gb|AAR89637.1|</td>
<td class="strand_start">207</td>
<td class="strand_pvalue">8.63e-07</td>
<td class="strand_lflank">KTLTEEFKGK</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:red;">K</span><span style="color:blue;">V</span><span style="color:turquoise;">Y</span><span style="color:blue;">F</span><span style="color:green;">T</span><span style="color:yellow;">P</span><span style="color:blue;">L</span>
</td>
<td class="strand_rflank">MTSDELEKIK</td>
</tr>
<tr>
<td class="strand_name">gi|37702017|gb|AAR00670.1|</td>
<td class="strand_start">235</td>
<td class="strand_pvalue">2.99e-06</td>
<td class="strand_lflank">RNMRCIECQH</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:magenta;">E</span><span style="color:orange;">G</span><span style="color:red;">K</span><span style="color:blue;">F</span><span style="color:green;">T</span><span style="color:yellow;">P</span><span style="color:green;">T</span>
</td>
<td class="strand_rflank">DFIMHHHYPI</td>
</tr>
<tr>
<td class="strand_name">gi|115528964|gb|AAI10506.2|</td>
<td class="strand_start">884</td>
<td class="strand_pvalue">3.25e-06</td>
<td class="strand_lflank">QETVKELAPR</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:magenta;">D</span><span style="color:blue;">V</span><span style="color:green;">T</span><span style="color:blue;">F</span><span style="color:blue;">M</span><span style="color:blue;">L</span><span style="color:green;">S</span>
</td>
<td class="strand_rflank">EDGSGKGAAL</td>
</tr>
<tr>
<td class="strand_name">gi|5323|emb|CAA42376.1|</td>
<td class="strand_start">447</td>
<td class="strand_pvalue">4.88e-06</td>
<td class="strand_lflank">KRYHGEVEIG</td>
<td class="strand_seq">
<span style="color:blue;">C</span><span style="color:magenta;">D</span><span style="color:orange;">G</span><span style="color:green;">S</span><span style="color:blue;">V</span><span style="color:blue;">V</span><span style="color:magenta;">E</span><span style="color:turquoise;">Y</span>
</td>
<td class="strand_rflank">YPGFRSMLRH</td>
</tr>
<tr>
<td class="strand_name">gi|33188217|gb|AAP97871.1|</td>
<td class="strand_start">76</td>
<td class="strand_pvalue">2.15e-05</td>
<td class="strand_lflank">TAGKSGYRAK</td>
<td class="strand_seq">
<span style="color:red;">R</span><span style="color:blue;">A</span><span style="color:blue;">W</span><span style="color:green;">Q</span><span style="color:blue;">F</span><span style="color:orange;">G</span><span style="color:green;">S</span><span style="color:blue;">W</span>
</td>
<td class="strand_rflank">VQDSGVGGGA</td>
</tr>
</tbody>
</table>
</div>
<h4>Block Diagrams <a href="#diagrams_doc" class="help"><div class="help"></div></a>
</h4>
<div class="pad">
<p>
        The height of the motif "block" is proportional to -log(p-value), truncated at the height for a motif with a p-value of 1e-10.<br>
        Click on any row to highlight sequence in all motifs. Mouse over the center of the motif blocks to see more information.
      </p>
<table id="tbl_blocks_1" style="width:100%;" border="0">
<col style="width:10em;">
<col style="width:5em;">
<col>
<thead><tr>
<th>Name</th>
<th>Lowest <i>p</i>-value</th>
<th>Motif Location</th>
</tr></thead>
<tbody>
<tr>
<td>gi|40764015|gb|AAR89637.1|</td>
<td>8.63e-07</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:100%"></div>
<div class="block_motif" style="left:14.375%; top:3.7px; width:0.556%; height:7.3px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 8.63e-07    starts: 208    ends: 215    "></div>
</div></td>
</tr>
<tr>
<td>gi|37702021|gb|AAR00672.1|</td>
<td>2.96e-09</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:86.7361111111111%"></div>
<div class="block_motif" style="left:40.764%; top:0.8px; width:0.556%; height:10.2px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 2.96e-09    starts: 588    ends: 595    "></div>
</div></td>
</tr>
<tr>
<td>gi|46452276|gb|AAS98221.1|</td>
<td>5.90e-07</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:43.8888888888889%"></div>
<div class="block_motif" style="left:35.486%; top:3.5px; width:0.556%; height:7.5px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 5.90e-07    starts: 512    ends: 519    "></div>
</div></td>
</tr>
<tr>
<td>gi|37702019|gb|AAR00671.1|</td>
<td>2.96e-09</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:86.9444444444444%"></div>
<div class="block_motif" style="left:40.972%; top:0.8px; width:0.556%; height:10.2px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 2.96e-09    starts: 591    ends: 598    "></div>
</div></td>
</tr>
<tr>
<td>gi|5323|emb|CAA42376.1|</td>
<td>4.88e-06</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:34.7222222222222%"></div>
<div class="block_motif" style="left:31.042%; top:4.6px; width:0.556%; height:6.4px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 4.88e-06    starts: 448    ends: 455    "></div>
</div></td>
</tr>
<tr>
<td>gi|46452280|gb|AAS98223.1|</td>
<td>5.90e-07</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:38.75%"></div>
<div class="block_motif" style="left:30.347%; top:3.5px; width:0.556%; height:7.5px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 5.90e-07    starts: 438    ends: 445    "></div>
</div></td>
</tr>
<tr>
<td>gi|41020884|gb|AAR98633.1|</td>
<td>1.25e-08</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:34.5833333333333%"></div>
<div class="block_motif" style="left:11.111%; top:1.5px; width:0.556%; height:9.5px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 1.25e-08    starts: 161    ends: 168    "></div>
</div></td>
</tr>
<tr>
<td>gi|33188217|gb|AAP97871.1|</td>
<td>2.15e-05</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:22.3611111111111%"></div>
<div class="block_motif" style="left:5.278%; top:5.4px; width:0.556%; height:5.6px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 2.15e-05    starts: 77    ends: 84    "></div>
</div></td>
</tr>
<tr>
<td>gi|75288178|gb|ABA18179.1|</td>
<td>7.13e-08</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:80.625%"></div>
<div class="block_motif" style="left:32.917%; top:2.4px; width:0.556%; height:8.6px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 7.13e-08    starts: 475    ends: 482    "></div>
</div></td>
</tr>
<tr>
<td>gi|40764042|gb|AAR89639.1|</td>
<td>6.50e-07</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:92.1527777777778%"></div>
<div class="block_motif" style="left:24.097%; top:3.6px; width:0.556%; height:7.4px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 6.50e-07    starts: 348    ends: 355    "></div>
</div></td>
</tr>
<tr>
<td>gi|40763973|gb|AAR89634.1|</td>
<td>1.77e-10</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:37.8472222222222%"></div>
<div class="block_motif" style="left:11.806%; top:-0.7px; width:0.556%; height:11.7px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 1.77e-10    starts: 171    ends: 178    "></div>
</div></td>
</tr>
<tr>
<td>gi|115528964|gb|AAI10506.2|</td>
<td>3.25e-06</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:63.6805555555556%"></div>
<div class="block_motif" style="left:61.389%; top:4.4px; width:0.556%; height:6.6px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 3.25e-06    starts: 885    ends: 892    "></div>
</div></td>
</tr>
<tr>
<td>gi|41020960|gb|AAR98636.1|</td>
<td>1.12e-09</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:38.4722222222222%"></div>
<div class="block_motif" style="left:11.25%; top:0.3px; width:0.556%; height:10.7px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 1.12e-09    starts: 163    ends: 170    "></div>
</div></td>
</tr>
<tr>
<td>gi|41020924|gb|AAR98635.1|</td>
<td>1.86e-08</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:35.4166666666667%"></div>
<div class="block_motif" style="left:11.667%; top:1.7px; width:0.556%; height:9.3px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 1.86e-08    starts: 169    ends: 176    "></div>
</div></td>
</tr>
<tr>
<td>gi|37702017|gb|AAR00670.1|</td>
<td>2.99e-06</td>
<td class="block_td"><div class="block_container">
<div class="block_rule" style="width:43.5416666666667%"></div>
<div class="block_motif" style="left:16.319%; top:4.4px; width:0.556%; height:6.6px; background-color:aqua; border: 1px solid black;" title="Motif 1    p-value: 2.99e-06    starts: 236    ends: 243    "></div>
</div></td>
</tr>
<tr>
<td colspan="2"> </td>
<td class="block_td" style="color: blue;"><div class="block_container">
<div class="tic_major" style="left:0%"><div class="tic_label" style="left:-0.5em; width:1em;">0</div></div>
<div class="tic_minor" style="left:2.778%;"></div>
<div class="tic_minor" style="left:5.556%;"></div>
<div class="tic_minor" style="left:8.333%;"></div>
<div class="tic_minor" style="left:11.111%;"></div>
<div class="tic_major" style="left:13.889%"><div class="tic_label" style="left:-1.5em; width:3em;">200</div></div>
<div class="tic_minor" style="left:16.667%;"></div>
<div class="tic_minor" style="left:19.444%;"></div>
<div class="tic_minor" style="left:22.222%;"></div>
<div class="tic_minor" style="left:25%;"></div>
<div class="tic_major" style="left:27.778%"><div class="tic_label" style="left:-1.5em; width:3em;">400</div></div>
<div class="tic_minor" style="left:30.556%;"></div>
<div class="tic_minor" style="left:33.333%;"></div>
<div class="tic_minor" style="left:36.111%;"></div>
<div class="tic_minor" style="left:38.889%;"></div>
<div class="tic_major" style="left:41.667%"><div class="tic_label" style="left:-1.5em; width:3em;">600</div></div>
<div class="tic_minor" style="left:44.444%;"></div>
<div class="tic_minor" style="left:47.222%;"></div>
<div class="tic_minor" style="left:50%;"></div>
<div class="tic_minor" style="left:52.778%;"></div>
<div class="tic_major" style="left:55.556%"><div class="tic_label" style="left:-1.5em; width:3em;">800</div></div>
<div class="tic_minor" style="left:58.333%;"></div>
<div class="tic_minor" style="left:61.111%;"></div>
<div class="tic_minor" style="left:63.889%;"></div>
<div class="tic_minor" style="left:66.667%;"></div>
<div class="tic_major" style="left:69.444%"><div class="tic_label" style="left:-2em; width:4em;">1000</div></div>
<div class="tic_minor" style="left:72.222%;"></div>
<div class="tic_minor" style="left:75%;"></div>
<div class="tic_minor" style="left:77.778%;"></div>
<div class="tic_minor" style="left:80.556%;"></div>
<div class="tic_major" style="left:83.333%"><div class="tic_label" style="left:-2em; width:4em;">1200</div></div>
<div class="tic_minor" style="left:86.111%;"></div>
<div class="tic_minor" style="left:88.889%;"></div>
<div class="tic_minor" style="left:91.667%;"></div>
<div class="tic_minor" style="left:94.444%;"></div>
<div class="tic_major" style="left:97.222%"><div class="tic_label" style="left:-2em; width:4em;">1400</div></div>
<div class="tic_minor" style="left:100%;"></div>
</div></td>
</tr>
</tbody>
</table>
</div>
<p>Time 9.3 secs.</p>
</div>
<div class="bar">
<div style="text-align:right;"><a href="#top_buttons">Top</a></div>
<div class="subsection">
<a name="version"></a><h5>MEME version</h5>4.6.0 (Release date: Thu Jan 20 14:06:48 PST 2011)
      </div>
<div class="subsection">
<a name="reference"></a><h5>Reference</h5>
        Timothy L. Bailey and Charles Elkan,
        "Fitting a mixture model by expectation maximization to discover
        motifs in biopolymers", Proceedings of the Second International
        Conference on Intelligent Systems for Molecular Biology, pp. 28-36,
        AAAI Press, Menlo Park, California, 1994.
      </div>
<a name="sequences"></a><a href="javascript:showHidden('trainingseq')" id="trainingseq_activator">show training set...</a><div class="subsection" id="trainingseq_data" style="display:none;">
<h5>Training set:</h5>
        Datafile = 21727.pos.fasta<br>
        Alphabet = ACDEFGHIKLMNPQRSTVWY<br><table>
<col>
<col>
<col>
<tr style="vertical-align:top;">
<td><table class="trainingset">
<col>
<col>
<col>
<tr>
<th>Sequence name</th>
<th>Weighting</th>
<th>Length</th>
</tr>
<tr>
<td>gi|40764015|gb|AAR89637.1|</td>
<td>1.000000</td>
<td>1440</td>
</tr>
<tr>
<td>gi|37702019|gb|AAR00671.1|</td>
<td>1.000000</td>
<td>1252</td>
</tr>
<tr>
<td>gi|41020884|gb|AAR98633.1|</td>
<td>1.000000</td>
<td>498</td>
</tr>
<tr>
<td>gi|40764042|gb|AAR89639.1|</td>
<td>1.000000</td>
<td>1327</td>
</tr>
<tr>
<td>gi|41020960|gb|AAR98636.1|</td>
<td>1.000000</td>
<td>554</td>
</tr>
</table></td>
<td><table class="trainingset">
<col>
<col>
<col>
<tr>
<th>Sequence name</th>
<th>Weighting</th>
<th>Length</th>
</tr>
<tr>
<td>gi|37702021|gb|AAR00672.1|</td>
<td>1.000000</td>
<td>1249</td>
</tr>
<tr>
<td>gi|5323|emb|CAA42376.1|</td>
<td>1.000000</td>
<td>500</td>
</tr>
<tr>
<td>gi|33188217|gb|AAP97871.1|</td>
<td>1.000000</td>
<td>322</td>
</tr>
<tr>
<td>gi|40763973|gb|AAR89634.1|</td>
<td>1.000000</td>
<td>545</td>
</tr>
<tr>
<td>gi|41020924|gb|AAR98635.1|</td>
<td>1.000000</td>
<td>510</td>
</tr>
</table></td>
<td><table class="trainingset">
<col>
<col>
<col>
<tr>
<th>Sequence name</th>
<th>Weighting</th>
<th>Length</th>
</tr>
<tr>
<td>gi|46452276|gb|AAS98221.1|</td>
<td>1.000000</td>
<td>632</td>
</tr>
<tr>
<td>gi|46452280|gb|AAS98223.1|</td>
<td>1.000000</td>
<td>558</td>
</tr>
<tr>
<td>gi|75288178|gb|ABA18179.1|</td>
<td>1.000000</td>
<td>1161</td>
</tr>
<tr>
<td>gi|115528964|gb|AAI10506.2|</td>
<td>1.000000</td>
<td>917</td>
</tr>
<tr>
<td>gi|37702017|gb|AAR00670.1|</td>
<td>1.000000</td>
<td>627</td>
</tr>
</table></td>
</tr>
</table>
</div>
<a href="javascript:hideShown('trainingseq')" style="display:none;" id="trainingseq_deactivator">hide training set...</a><div class="subsection">
<a name="command"></a><h5>Command line summary</h5>
<textarea rows="1" style="width:100%;" readonly>meme 21727.pos.fasta -oc 21727 -mod oops -nmotifs 1 -minw 8 -maxw 50 -minsites 1 -maxsites 50 </textarea><br>
        Letter frequencies in dataset<br><div style="margin-left:25px;">A: 0.073   C: 0.017   D: 0.055   E: 0.065   F: 0.045   G: 0.067   H: 0.021   I: 0.067   K: 0.071   L: 0.092   M: 0.030   N: 0.041   P: 0.042   Q: 0.036   R: 0.048   S: 0.067   T: 0.059   V: 0.067   W: 0.012   Y: 0.026</div>
<br>
        Background letter frequencies (from dataset with add-one prior applied):<br><div style="margin-left:25px;">A: 0.073   C: 0.017   D: 0.055   E: 0.065   F: 0.045   G: 0.067   H: 0.021   I: 0.067   K: 0.071   L: 0.092   M: 0.030   N: 0.041   P: 0.042   Q: 0.036   R: 0.048   S: 0.067   T: 0.059   V: 0.067   W: 0.012   Y: 0.026</div>
<br>
</div>
<div class="subsection">
<a name="stopped"></a><h5>Stopping Reason</h5>Stopped because nmotifs = 1 reached. Program ran on <i>h4evr-laptop</i>.
      </div>
<a href="javascript:showHidden('model')" id="model_activator">show model parameters...</a><div class="subsection" id="model_data" style="display:none;">
<h5>Model parameters</h5>
<textarea style="width:100%;" rows="28" readonly>
host                  = h4evr-laptop
type                  = oops
nmotifs               = 1
evalue_threshold      = inf
object_function       = E-value of product of p-values
min_width             = 8
max_width             = 50
minic                 = 0.00
wg                    = 11
ws                    = 1
endgaps               = yes
minsites              = 15
maxsites              = 15
wnsites               = 0.8
prob                  = 1
spmap                 = pam
spfuzz                = 120
prior                 = dmix
beta                  = 0
maxiter               = 50
distance              = 1e-05
num_sequences         = 15
num_positions         = 12092
seed                  = 0
seqfrac               = 1
strands               = none
priors_file           = prior30.plib
reason_for_stopping   = Stopped because nmotifs = 1 reached.
</textarea>
</div>
<a href="javascript:hideShown('model')" style="display:none;" id="model_deactivator">hide model parameters...</a>
</div>
<span class="explain"><a name="explanation"></a><table width="100%" border="0" cellspacing="1" cellpadding="4" bgcolor="#FFFFFF"><tr>
<td><h2 class="mainh">Explanation of MEME Results</h2></td>
<td align="right" valign="bottom"><a href="#top_buttons">Top</a></td>
</tr></table>
<div class="box">
<h4>The MEME results consist of</h4>
<ul>
<li>The <a href="#overview"><b>overview</b></a> of all discovered motifs.</li>
<li>Information on each of the <a href="#motifs"><b>motifs</b></a> MEME discovered, including:
            <ol>
<li>
                A <a href="#summary_doc"><b>summary table</b></a> showing the width, number of contributing sites, log likelihood ratio, 
                statistical significance, information content and relative entropy of the motif.
              </li>
<li>A <a href="#logo_doc"><b>sequence LOGO</b></a>.</li>
<li>Downloadable <a href="#download"><b>LOGO files</b></a> suitable for publication.</li>
<li>A <a href="#regular_expression_doc"><b>regular expression</b></a> describing the motif.</li>
<li>Some <a href="#further_analysis_doc"><b>further analysis</b></a> that can be performed on the motif.</li>
<li>A list of <a href="#formats_doc"><b>data formats</b></a> describing the motif.</li>
<li>The <a href="#sites_doc"><b>contributing sites</b></a> of the motif sorted by <i>p</i>-value and aligned with each other.</li>
<li>
                The <a href="#diagrams_doc"><b>block diagrams</b></a> of the contributing sites of the motif within each sequence in the training set.
              </li>
</ol>
</li>
<li>A <a href="#combined"><b>combined block diagram</b></a> showing an optimized (non-overlapping) 
             tiling of all of the motifs onto each of the sequences in the training set.
          </li>
<li>The <a href="#version"><b>version</b></a> of MEME and the date it was released.</li>
<li>The <a href="#reference"><b>reference</b></a> to cite if you use MEME in your research.</li>
<li>
            A description of the <a href="#sequences"><b>sequences</b></a> you submitted (the "training set") showing the name,
            "weight" and length of each sequence.
          </li>
<li>The <a href="#command"><b>command line summary</b></a> detailing the parameters with which you ran MEME.</li>
<li>The reason why MEME <a href="#stopped"><b>stopped</b></a> and the name of the CPU on which it ran.</li>
<li>This <b>explanation</b> of how to interpret MEME results.</li>
</ul>
<a name="motifs"></a><h4>Motifs</h4>
<p>
          For each motif that it discovers in the training set,
          MEME prints the following information:
        </p>
<a name="summary_doc"></a><h5>Summary Table</h5>
<div class="doc">
<p>
            This summary table gives the main attributes of the motif.
          </p>
<dl>
<dt>
<i>E</i>-value</dt>
<dd>
              The statistical significance of the motif. MEME usually finds the most statistically significant (low <i>E</i>-value) motifs first.
              The <i>E</i>-value of a motif is based on its log likelihood ratio, width, sites, the background letter frequencies (given in the 
              <a href="#command">command line summary</a>), and the size of the training set. The <i>E</i>-value is an estimate of the expected 
              number of motifs with the given log likelihood ratio (or higher), and with the same width and site count, that one would find in 
              a similarly sized set of random sequences. (In random sequences each position is independent with letters chosen according to 
              the background letter frequencies.)
            </dd>
<dt>Width</dt>
<dd>The width of the motif. Each motif describes a pattern of a fixed with as no gaps are allowed in MEME motifs.</dd>
<dt>Sites</dt>
<dd>The number of sites contributing to the construction of the motif.</dd>
<dt>
<a name="llr_doc"></a>Log Likelihood Ratio</dt>
<dd>
              The log likelihood ratio of the motif.The log likelihood ratio is the logarithm of the ratio of the probability of the occurrences 
              of the motif given the motif model (likelihood given the motif) versus their probability given the background model 
              (likelihood given the null model). (Normally the background model is a 0-order Markov model using the background letter 
              frequencies, but higher order Markov models may be specified via the <b>-bfile</b> option to MEME.)
            </dd>
<dt>
<a name="ic_doc"></a>Information Content</dt>
<dd>
              The information content of the motif in bits. It is equal to the sum of the <b>uncorrected</b> information content, <tt>R()</tt>, 
              in the columns of the <a href="#logo_doc">LOGO</a>. This is equal relative entropy of the motif relative to a uniform background frequency 
              model.
            </dd>
<dt>
<a name="re_doc"></a>Relative Entropy</dt>
<dd>
              The relative entropy of the motif, computed in bits and relative to the background letter frequencies given in the 
              <a href="#command">command line summary</a>. It is equal to the log-likelihood ratio (llr) divided by the 
              number of contributing sites of the motif times <tt>1/ln(2)</tt>,<br><br><tt>re = llr / (sites * ln(2))</tt>.
            </dd>
</dl>
</div>
<a name="logo_doc"></a><h5 class="doc">Sequence LOGO</h5>
<div class="doc">
<p>
            MEME motifs are represented by position-specific probability matrices 
            that specify the probability of each possible letter appearing at each
            possible position in an occurrence of the motif.  These are displayed
            as "sequence LOGOS", containing stacks of letters at each position
            in the motif.  The total height of the stack is the "information
            content" of that position in the motif in bits.  The height of the 
            individual letters in a stack is the probability of the letter at that 
            position multiplied by the total information content of the stack.
          </p>
<p>
            Note: The MEME LOGO differs from those produced by the 
            <a href="http://weblogo.berkeley.edu">Weblogo</a> program
            because a <b>small-sample correction is NOT applied</b>.  
            However, MEME LOGOs in PNG and encapsulated postscript (EPS) formats 
            <b>with small-sample correction (SSC)</b> are available by clicking 
            on the download button with "SSC" set to "on" under 
            <a href="#download_doc">Download LOGO</a>.
            The MEME LOGOs without small sample correction are similarly available.
            Error bars are included in the LOGOs with small-sample correction.
          </p>
<p>
            Modern web browsers supporting the canvas element and it's text manipulation functions as described in the 
            html 5 standard, can render the sequence LOGOs without needing the images. The browsers which work with this
            feature are:
          </p>
<ul>
<li>Firefox 3.5 and above</li>
<li>Safari 4 and above</li>
<li>Google Chrome 4 and above</li>
</ul>
<p>
            Unfortunately Internet Explorer 8 does not support any html 5 features.          
          </p>
<p>          
            The information content of each motif position is computed as described in the paper by Schneider and Stephens, 
            "Sequence Logos: A New Way to Display Consensus Sequences" but 
            <b>the small-sample correction, <tt>e(n)</tt>, is set to zero for the LOGO displayed in the MEME output.</b>
            The corrected information content of position <tt>i</tt> is given by
          </p>
<pre>
            R(i) for amino acids   = log2(20) - (H(i) + e(n))   (1a) 
            R(i) for nucleic acids =    2    - (H(i) + e(n))    (1b)
          </pre>
<p>where H(i) is the entropy of position <tt>i</tt>,</p>
<pre>
            H(l) = - (Sum f(a,i) * log2[ f(a,i) ]).             (2)
          </pre>
<p>
            Here, f(a,i) is the frequency of base or amino acid <tt>a</tt> at position <tt>i</tt>, and <tt>e(n)</tt> is the small-sample correction 
            for an alignment of <tt>n</tt> letters. The height of letter <tt>a</tt> in column <tt>i</tt> is given by
          </p>
<pre>
            height = f(a,i) * R(i)                              (3)
          </pre>
<p>The approximation for the small-sample correction, <tt>e(n)</tt>, is given by:</p>
<pre>
            e(n) = (s-1) / (2 * ln(2) * n),                     (4)
          </pre>
<p>where <tt>s</tt> is 4 for nucleotides, 20 for amino acids, and <tt>n</tt> is the number of sequences in the alignment.</p>
<p>
            The letters in the logos are colored as follows.<br>
            For DNA sequences, the letter categories contain one letter each.
          </p>
<table border="1">
<thead><tr>
<th>NUCLEIC ACIDS</th>
<th>COLOR</th>
</tr></thead>
<tbody>
<tr>
<td>A</td>
<td style="color:red;">RED</td>
</tr>
<tr>
<td>C</td>
<td style="color:blue;">BLUE</td>
</tr>
<tr>
<td>G</td>
<td style="color:orange;">ORANGE</td>
</tr>
<tr>
<td>T</td>
<td style="color:green;">GREEN</td>
</tr>
</tbody>
</table>
<p>For proteins, the categories are based on the biochemical properties of the various amino acids.</p>
<table border="1">
<thead><tr>
<th>AMINO ACIDS</th>
<th>COLOR</th>
<th>PROPERTIES</th>
</tr></thead>
<tbody>
<tr>
<td>A, C, F, I, L, V, W and M</td>
<td style="color:blue;">BLUE</td>
<td>Most hydrophobic[Kyte and Doolittle, 1982]</td>
</tr>
<tr>
<td>NQST</td>
<td style="color:green;">GREEN</td>
<td>Polar, non-charged, non-aliphatic residues</td>
</tr>
<tr>
<td>DE</td>
<td style="color:magenta;">MAGENTA</td>
<td>Acidic</td>
</tr>
<tr>
<td>KR</td>
<td style="color:red;">RED</td>
<td>Positively charged</td>
</tr>
<tr>
<td>H</td>
<td style="color:pink;">PINK</td>
<td> </td>
</tr>
<tr>
<td>G</td>
<td style="color:orange;">ORANGE</td>
<td> </td>
</tr>
<tr>
<td>P</td>
<td style="color:yellow;">YELLOW</td>
<td> </td>
</tr>
<tr>
<td>Y</td>
<td style="color:turquoise;">TURQUOISE</td>
<td> </td>
</tr>
</tbody>
</table>
<p>
            J. Kyte and R. Doolittle, 1982. "A Simple Method for Displaying the Hydropathic Character of a Protein",
            J. Mol Biol. 157, 105-132.
          </p>
<p><b>Note:</b> the "text" output format of MEME preserves the historical MEME format where LOGOS are replaced by a simplified probability 
            matrix, a relative entropy plot, and a multi-level consensus sequence.
          </p>
</div>
<a name="download_doc"></a><h5 class="doc">Download LOGO</h5>
<div class="doc"><p>
            Logos can be generated on the fly by the meme webservice and you may specify a number of options to customize them to your needs.
            The options are:
            <dl>
<dt>Orientation</dt>
<dd>Only valid for nucleotide motifs. Generate the standard view or the reverse complemented view of the motif.</dd>
<dt>SSC</dt>
<dd>Use small sample correction and show errorbars on the image. 
                Small sample correction is used by the <a href="http://weblogo.berkeley.edu">Weblogo</a> program.</dd>
<dt>Format</dt>
<dd>The format of the generated image. 
                If the image is to be used on the web then png is recommend.
                If the image is to be published then eps is recommended.
              </dd>
<dt>Width</dt>
<dd>The width of the generated image in centimetres.</dd>
<dt>Height</dt>
<dd>The height of the generated image in centimetres.</dd>
</dl></p></div>
<a name="regular_expression_doc"></a><h5>Regular Expression</h5>
<div class="doc"><p>
            This is a regular expression (RE) describing the motif.  In each column, all letters with observed frequencies greater than 0.2 are shown;
            less-frequent letters are not included in the RE. MEME regular expressions are interpreted as follows: single letters match that letter; 
            groups of letters in square brackets match any of the letters in the group. Regular expressions can be used for searching for the motif 
            in sequences (using, for example, <a href="http://nar.oxfordjournals.org/cgi/content/full/33/suppl_2/W262">PatMatch</a>) but the search 
            accuracy will usually be better with the PSSM (using, for example <a href="http://meme.nbcr.net/meme/mast-intro.html">MAST</a>.)
          </p></div>
<a name="further_analysis_doc"></a><h5>Further Analysis</h5>
<div class="doc">
<p>Either as a group or individually the motifs have a number of options for further analysis.</p>
<dl>
<dt>
<a name="MAST_doc"></a>MAST</dt>
<dd>
              Finds the best matching positions for a set of motifs in each sequence provided to it, ranked by the combined score of each sequence.
              For more information about MAST please read the <a href="http://meme.nbcr.net/meme/mast-intro.html">introduction</a>.
            </dd>
<dt>
<a name="FIMO_doc"></a>FIMO</dt>
<dd>
              Finds all matches for a motif.
              For more information about FIMO please read the <a href="http://meme.nbcr.net/meme/fimo-intro.html">introduction</a>.
            </dd>
<dt>
<a name="TOMTOM_doc"></a>TOMTOM</dt>
<dd>
              Compares a single motif to a database of motifs.
              For more information about TOMTOM please read the <a href="http://meme.nbcr.net/meme/tomtom-intro.html">introduction</a>.
            </dd>
<dt>
<a name="GOMO_doc"></a>GOMO</dt>
<dd>
              Identifies possible roles of DNA binding motifs.
              For more information about GOMO please read the <a href="http://meme.nbcr.net/meme/gomo-intro.html">introduction</a>.
            </dd>
<dt>
<a name="BLOCKS_doc"></a>BLOCKS</dt>
<dd>
              Submit to Blocks Multiple Alignment Processor where you can do several things like create phylogeny trees and search the blocks 
              against a database of other blocks (protein only). For more information about BLOCKS Multiple Alignment Processor please visit the 
              <a href="http://blocks.fhcrc.org/blocks/process_blocks.html">website</a>.
            </dd>
</dl>
</div>
<a name="formats_doc"></a><h5>Data Formats</h5>
<div class="doc">
<p>The extracted data is avaliable in the following formats.</p>
<dl>
<dt>
<a name="format_PSPM_doc"></a>PSPM Format</dt>
<dd>
              The motif itself is a position-specific probability matrix giving, for each position in the pattern, the observed frequency ("probability") 
              of each possible letter. The probability matrix is printed "sideways"--columns correspond to the letters in the alphabet (in the same order 
              as shown in the simplified motif) and rows corresponding to the positions of the motif, position one first. The motif is preceded by a line 
              starting with "letter-probability matrix:" and containing the length of the alphabet, width of the motif, number of occurrences of the motif,
              and the <i>E</i>-value of the motif.<br><b>Note:</b> Earlier versions of MEME gave the posterior probabilities--the probability after applying a prior on letter frequencies--rather 
              than the observed frequencies. These versions of MEME also gave the number of <i>possible</i> positions for the motif rather than the actual 
              number of occurrences. The output from these earlier versions of MEME can be distinguished by "n=" rather than "nsites=" in the line 
              preceding the matrix.
            </dd>
<dt>
<a name="format_PSSM_doc"></a>PSSM Format</dt>
<dd>
              The position-specific scoring matrix corresponding to the motif is printed for use by database search programs such as MAST.
              This matrix is a log-odds matrix calculated by taking 100 times the log (base 2) of the ratio <i>p/f</i> at each position in
              the motif where <i>p</i> is the probability of a particular letter at that position in the motif, and <i>f</i> is the background 
              frequency of the letter (given in the <a href="#command">command line summary</a> section.) This is the same matrix that is used 
              above in computing the <i>p</i>-values of the occurrences of the motif in the <a href="#sites_doc">Sites</a>
              and <a href="#diagrams_doc">Block Diagrams</a> sections. The scoring matrix is printed "sideways"--columns
              correspond to the letters in the alphabet (in the same order as shown in the simplified motif) and rows corresponding to the 
              positions of the motif, position one first. The scoring matrix is preceded by a line starting with "log-odds matrix:" and 
              containing the length of the alphabet, width of the motif, number of characters in the training set, the scoring threshold 
              (obsolete) and the motif <i>E</i>-value.<br><b>Note:</b> The probability <i>p</i> used to compute the PSSM is <i>not</i> exactly the same as the corresponding value in the 
              Position Specific Probability Matrix (PSPM). The values of <i>p</i> used to compute the PSSM take into account the motif prior, 
              whereas the values in the PSPM are just the <i>observed</i> frequencies of letters in the motif sites.
            </dd>
<dt>
<a name="format_BLOCKS_doc"></a>BLOCKS Format</dt>
<dd>
              For use with <a href="http://blocks.fhcrc.org/blocks">BLOCKS tools</a>.
            </dd>
<dt>
<a name="format_FASTA_doc"></a>FASTA Format</dt>
<dd>
              The FASTA format as described <a href="http://meme.nbcr.net/meme/doc/fasta-format.html">here</a>.
            </dd>
<dt>
<a name="format_raw_doc"></a>Raw Format</dt>
<dd>
              Just the sites of the sequences that contributed to the motif. One site per line.
            </dd>
</dl>
</div>
<a name="sites_doc"></a><h5 class="doc">Sites</h5>
<div class="doc"><p>
            MEME displays the occurrences (sites) of the motif in the training set. The sites are shown aligned with each other, and the ten sequence
            positions preceding and following each site are also shown. Each site is identified by the name of the sequence where it occurs,
            the strand (if both strands of DNA sequences are being used), and the position in the sequence where the site begins.  When the DNA strand
            is specified, '+' means the sequence in the training set, and '-' means the reverse complement of the training set sequence.
            (For '-' strands, the 'start' position is actually the position on the <b>positive</b> strand where the site ends.) The sites are <b>listed 
              in order of increasing statistical significance</b> (<i>p</i>-value).  The <i>p</i>-value of a site is computed from the the match score of 
            the site with the <a href="#format_PSSM_doc">position specific scoring matrix</a> for the motif. The <i>p</i>-value gives the probability of a 
            random string (generated from the background letter frequencies) having the same match score or higher. (This is referred to as the 
            <b>position <i>p</i>-value</b> by the MAST algorithm.)
          </p></div>
<a name="diagrams_doc"></a><h5 class="doc">Block Diagrams</h5>
<div class="doc"><p>
            The occurrences of the motif in the training set sequences are shown as coloured blocks on a line. One diagram is printed for each
            sequence showing all the sites contributating to that motif in that sequence. The sequences are <b>listed in the same order as in the input</b> 
            to make it easier to compare multiple block diagrams. Additionally the best <i>p</i>-value for the sequence/motif combination is
            listed though this may not be in ascending order as with the sites. The <i>p</i>-value of an occurrence is the probability of a single
            random subsequence the length of the motif, generated according to the 0-order background model, having a score at least as high as 
            the score of the occurrence. When the DNA strand is specified '+', it means the motif appears from left to right on the sequence, and '-' 
            means the motif appears from right to left on the complementary strand. A sequence position scale is shown at the end of each table of 
            block diagrams. 
          </p></div>
<a name="combined_doc"></a><h5>Combined Block Diagrams</h5>
<div class="doc">
<p>
            The motif occurrences shown in the motif summary <b>may not be exactly the same as those reported in each motif section</b> because 
            only motifs with a position <em>p</em>-value of 0.0001 that don't overlap other, more significant motif occurrences are shown. 
          </p>
<p>
            See the documentation for <a href="http://meme.nbcr.net/meme/mast-output.html">MAST output</a> for the definition of position and
            combined <em>p</em>-values.
          </p>
</div>
</div></span><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</form></body>
</html>
